Package org.apache.uima.ruta.resource

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


    int ignoreLengthValue = ignoreLength.getIntegerValue(parent, match, element, stream);
    boolean editValue = edit.getBooleanValue(parent, match, element, stream);
    double distanceValue = distance.getDoubleValue(parent, match, element, stream);
    String ignoreCharValue = ignoreChar.getStringValue(parent, match, element, stream);

    RutaWordList wl = list.getList(parent);
    Collection<AnnotationFS> found = wl.find(stream, typeMap, ignoreCaseValue, ignoreLengthValue,
            editValue, distanceValue, ignoreCharValue);

    if (found != null) {
      for (AnnotationFS annotation : found) {
        stream.addAnnotation(annotation, match);
View Full Code Here


  @Override
  public void execute(RuleMatch match, RuleElement element, RutaStream stream, InferenceCrowd crowd) {
    List<AnnotationFS> matchedAnnotationsOf = match.getMatchedAnnotationsOf(element);
    for (AnnotationFS annotationFS : matchedAnnotationsOf) {
      RutaStream windowStream = stream.getWindowStream(annotationFS, annotationFS.getType());
      RutaWordList wl = null;
      RutaBlock parent = element.getParent();
      if (list != null) {
        wl = list.getList(parent);
      } else if (stringList != null) {
        wl = new TreeWordList(stringList.getList(parent, stream));
      }
      if (wl instanceof TreeWordList) {
        Collection<AnnotationFS> found = wl.find(windowStream,
                ignore.getBooleanValue(parent, match, element, stream),
                ignoreLength.getIntegerValue(parent, match, element, stream), null, 0,
                ignoreWS.getBooleanValue(parent, match, element, stream));
        for (AnnotationFS annotation : found) {
          createAnnotation(annotation, element, windowStream, match);
View Full Code Here

  @Override
  public EvaluatedCondition eval(AnnotationFS annotation, RuleElement element, RutaStream stream,
          InferenceCrowd crowd) {
    String coveredText = annotation.getCoveredText();
    if (stringList == null) {
      RutaWordList wordList = listExpr.getList(element.getParent());
      return new EvaluatedCondition(this, wordList.contains(coveredText, false, 0, null, 0, true));
    }
    List<String> sList = stringList.getList(element.getParent(), stream);
    boolean contains = sList.contains(coveredText);
    return new EvaluatedCondition(this, contains);
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.ruta.resource.RutaWordList

Copyright © 2018 www.massapicom. 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.