Examples of RutaTable


Examples of org.apache.uima.ruta.resource.RutaTable

    return wordLists.get(list);
  }

  public RutaTable getWordTable(String table) {
    RutaTable result = tables.get(table);
    if (result == null) {
      ResourceLoader resourceLoader = new RutaResourceLoader(getResourcePaths());
      Resource resource = resourceLoader.getResource(table);
      if (resource.exists()) {
        try {
View Full Code Here

Examples of org.apache.uima.ruta.resource.RutaTable

        RutaWordList list = getWordList((String) value);
        return list;
      } else if (clazz.equals(RutaTable.class) && value instanceof LiteralWordTableExpression) {
        LiteralWordTableExpression lte = (LiteralWordTableExpression) value;
        String path = lte.getText();
        RutaTable table = getWordTable(path);
        return table;
      } else if (clazz.equals(RutaTable.class)) {
        RutaTable table = getWordTable((String) value);
        return table;
      } else if (clazz.equals(List.class) && value instanceof ListExpression) {
        List list = getList((ListExpression) value);
        return list;
      } else if (clazz.equals(Type.class) && value instanceof CommonToken) {
View Full Code Here

Examples of org.apache.uima.ruta.resource.RutaTable

    return wordLists.get(list);
  }

  public RutaTable getWordTable(String table) {
    RutaTable result = tables.get(table);
    if (result == null) {
      ResourceLoader resourceLoader = new RutaResourceLoader(getResourcePaths());
      Resource resource = resourceLoader.getResource(table);
      if (resource.exists()) {
        try {
View Full Code Here

Examples of org.apache.uima.ruta.resource.RutaTable

        RutaWordList list = getWordList((String) value);
        return list;
      } else if (clazz.equals(RutaTable.class) && value instanceof LiteralWordTableExpression) {
        LiteralWordTableExpression lte = (LiteralWordTableExpression) value;
        String path = lte.getText();
        RutaTable table = getWordTable(path);
        return table;
      } else if (clazz.equals(RutaTable.class)) {
        RutaTable table = getWordTable((String) value);
        return table;
      } else if (clazz.equals(List.class) && value instanceof ListExpression) {
        List list = getList((ListExpression) value);
        return list;
      } else if (clazz.equals(Type.class) && value instanceof CommonToken) {
View Full Code Here

Examples of org.apache.uima.ruta.resource.RutaTable

    return result.replaceAll("\\\\\\\"", "\\\"");
  }

  @Override
  public RutaTable getTable(RutaStatement element) {
    RutaTable table = element.getEnvironment().getWordTable(getText());
    return table;
  }
View Full Code Here

Examples of org.apache.uima.ruta.resource.RutaTable

  }

  @Override
  public void execute(RuleMatch match, RuleElement element, RutaStream stream, InferenceCrowd crowd) {
    RutaBlock block = element.getParent();
    RutaTable table = tableExpr.getTable(block);
    int index = indexExpr.getIntegerValue(block, match, element, stream);
    Type type = typeExpr.getType(block);
    Map<String, Integer> map = new HashMap<String, Integer>();
    for (IStringExpression each : featureMap.keySet()) {
      map.put(each.getStringValue(block, match, element, stream), featureMap.get(each)
              .getIntegerValue(block, match, element, stream));
    }

    boolean ignoreCaseValue = ignoreCase != null ? ignoreCase.getBooleanValue(element.getParent(),
            null, stream) : false;
    int ignoreLengthValue = ignoreLength != null ? ignoreLength.getIntegerValue(
            element.getParent(), null, stream) : 0;
    String ignoreCharValue = ignoreChar != null ? ignoreChar.getStringValue(element.getParent(),
            null, stream) : "";
    int maxIgnoreCharValue = maxIgnoreChar != null ? maxIgnoreChar.getIntegerValue(
            element.getParent(), null, stream) : 0;

    RutaWordList wordList = table.getWordList(index);
    Collection<AnnotationFS> found = wordList.find(stream, ignoreCaseValue, ignoreLengthValue,
            ignoreCharValue.toCharArray(), maxIgnoreCharValue, true);
    for (AnnotationFS annotationFS : found) {
      List<String> rowWhere = table.getRowWhere(index - 1, annotationFS.getCoveredText());
      FeatureStructure newFS = stream.getCas().createFS(type);
      if (newFS instanceof Annotation) {
        Annotation a = (Annotation) newFS;
        a.setBegin(annotationFS.getBegin());
        a.setEnd(annotationFS.getEnd());
View Full Code Here

Examples of org.apache.uima.ruta.resource.RutaTable

    return result.replaceAll("\\\\\\\"", "\\\"");
  }

  @Override
  public RutaTable getTable(RutaStatement element) {
    RutaTable table = element.getEnvironment().getWordTable(getText());
    return table;
  }
View Full Code Here

Examples of org.apache.uima.ruta.resource.RutaTable

  @Override
  public void execute(RuleMatch match, RuleElement element, RutaStream stream,
          InferenceCrowd crowd) {
    RutaBlock block = element.getParent();
    RutaTable table = tableExpr.getTable(block);
    int index = indexExpr.getIntegerValue(block);
    Type type = typeExpr.getType(block);
    Map<String, Integer> map = new HashMap<String, Integer>();
    for (StringExpression each : featureMap.keySet()) {
      map.put(each.getStringValue(block), featureMap.get(each).getIntegerValue(block));
    }

    boolean ignoreCaseValue = ignoreCase != null ? ignoreCase.getBooleanValue(element.getParent())
            : false;
    int ignoreLengthValue = ignoreLength != null ? ignoreLength
            .getIntegerValue(element.getParent()) : 0;
    String ignoreCharValue = ignoreChar != null ? ignoreChar.getStringValue(element.getParent())
            : "";
    int maxIgnoreCharValue = maxIgnoreChar != null ? maxIgnoreChar.getIntegerValue(element
            .getParent()) : 0;

    RutaWordList wordList = table.getWordList(index);
    Collection<AnnotationFS> found = wordList.find(stream, ignoreCaseValue, ignoreLengthValue,
            ignoreCharValue.toCharArray(), maxIgnoreCharValue, true);
    for (AnnotationFS annotationFS : found) {
      List<String> rowWhere = table.getRowWhere(index - 1, annotationFS.getCoveredText());
      FeatureStructure newFS = stream.getCas().createFS(type);
      if (newFS instanceof Annotation) {
        Annotation a = (Annotation) newFS;
        a.setBegin(annotationFS.getBegin());
        a.setEnd(annotationFS.getEnd());
View Full Code Here

Examples of org.apache.uima.ruta.resource.RutaTable

    }
    return wordLists.get(list);
  }

  public RutaTable getWordTable(String table) {
    RutaTable result = tables.get(table);
    if (result == null) {
      boolean found = false;
      for (String eachPath : resourcePaths) {
        File file = new File(eachPath, table);
        if (!file.exists()) {
View Full Code Here

Examples of org.apache.uima.ruta.resource.RutaTable

        RutaWordList list = getWordList((String) value);
        return list;
      } else if (clazz.equals(RutaTable.class) && value instanceof LiteralWordTableExpression) {
        LiteralWordTableExpression lte = (LiteralWordTableExpression) value;
        String path = lte.getText();
        RutaTable table = getWordTable(path);
        return table;
      } else if (clazz.equals(RutaTable.class)) {
        RutaTable table = getWordTable((String) value);
        return table;
      } else if (clazz.equals(List.class) && value instanceof ListExpression) {
        List list = getList((ListExpression) value);
        return list;
      } else if (clazz.equals(Type.class) && value instanceof CommonToken) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.