Examples of beginsWith()


Examples of org.apache.uima.ruta.type.RutaBasic.beginsWith()

      }
      String name = type.getName();
      RutaBasic firstBasicOfAll = stream.getFirstBasicOfAll();
      if ("uima.tcas.DocumentAnnotation".equals(name)
              || "org.apache.uima.ruta.type.Document".equals(name)
              || (stream.getDocumentAnnotationType().getName().equals(name) && (firstBasicOfAll != null && firstBasicOfAll
                      .beginsWith(type)))) {
        // TODO what about dynamic windowing?
        annotations.add(stream.getDocumentAnnotation());
      } else {
        annotations.addAll(stream.getAnnotations(type));
View Full Code Here

Examples of org.apache.uima.ruta.type.RutaBasic.beginsWith()

    Type contextType = type.getType(element.getParent());
    stream.moveToFirst();
    List<AnnotationFS> visibleContexts = new ArrayList<AnnotationFS>();
    while (stream.isValid()) {
      RutaBasic each = (RutaBasic) stream.get();
      if (each.beginsWith(contextType)) {
        visibleContexts.addAll(each.getBeginAnchors(contextType));
      }
      stream.moveToNext();
    }
    List<AnnotationFS> overlappingContexts = new ArrayList<AnnotationFS>();
View Full Code Here

Examples of org.apache.uima.ruta.type.RutaBasic.beginsWith()

  @Override
  public EvaluatedCondition eval(AnnotationFS annotation, RuleElement element, RutaStream stream,
          InferenceCrowd crowd) {
    RutaBasic endAnchor = stream.getEndAnchor(annotation.getEnd());
    Type t = type.getType(element.getParent());
    boolean result = endAnchor.beginsWith(t) && endAnchor.endsWith(t);
    return new EvaluatedCondition(this, result);
  }

}
View Full Code Here

Examples of org.apache.uima.ruta.type.RutaBasic.beginsWith()

  private boolean check(AnnotationFS annotation, Type t, RutaStream stream) {
    if (annotation == null) {
      return false;
    }
    RutaBasic beginAnchor = stream.getBeginAnchor(annotation.getBegin());
    return beginAnchor.beginsWith(t);
  }

}
View Full Code Here

Examples of org.apache.uima.ruta.type.RutaBasic.beginsWith()

    boolean result = false;
    if (fs instanceof RutaBasic) {
      RutaBasic tmb = (RutaBasic) fs;
      if (types != null) {
        for (Type each : types) {
          result |= tmb.isPartOf(each)|| tmb.beginsWith(each) || tmb.endsWith(each);
          if (result)
            break;
        }
      }
    }
View Full Code Here

Examples of org.apache.uima.ruta.type.RutaBasic.beginsWith()

      }
      String name = type.getName();
      RutaBasic firstBasicOfAll = stream.getFirstBasicOfAll();
      if ("uima.tcas.DocumentAnnotation".equals(name)
              || "org.apache.uima.ruta.type.Document".equals(name)
              || (stream.getDocumentAnnotationType().getName().equals(name) && (firstBasicOfAll != null && firstBasicOfAll
                      .beginsWith(type)))) {
        // TODO what about dynamic windowing?
        result.add(stream.getDocumentAnnotation());
      } else {
        stream.moveToFirst();
View Full Code Here

Examples of org.apache.uima.ruta.type.RutaBasic.beginsWith()

    Type contextType = type.getType(element.getParent());
    stream.moveToFirst();
    List<AnnotationFS> visibleContexts = new ArrayList<AnnotationFS>();
    while (stream.isValid()) {
      RutaBasic each = (RutaBasic) stream.get();
      if (each.beginsWith(contextType)) {
        visibleContexts.addAll(each.getBeginAnchors(contextType));
      }
      stream.moveToNext();
    }
    List<AnnotationFS> overlappingContexts = new ArrayList<AnnotationFS>();
View Full Code Here

Examples of org.apache.uima.ruta.type.RutaBasic.beginsWith()

  @Override
  public EvaluatedCondition eval(AnnotationFS annotation, RuleElement element,
          RutaStream stream, InferenceCrowd crowd) {
    RutaBasic endAnchor = stream.getEndAnchor(annotation.getEnd());
    Type t = type.getType(element.getParent());
    boolean result = endAnchor.beginsWith(t) && endAnchor.endsWith(t);
    return new EvaluatedCondition(this, result);
  }

}
View Full Code Here

Examples of org.apache.uima.ruta.type.RutaBasic.beginsWith()

  private boolean check(AnnotationFS annotation, Type t, RutaStream stream) {
    if (annotation == null) {
      return false;
    }
    RutaBasic beginAnchor = stream.getBeginAnchor(annotation.getBegin());
    return beginAnchor.beginsWith(t);
  }

}
View Full Code Here

Examples of org.apache.uima.ruta.type.RutaBasic.beginsWith()

    boolean result = false;
    if (fs instanceof RutaBasic) {
      RutaBasic tmb = (RutaBasic) fs;
      if (types != null) {
        for (Type each : types) {
          result |= tmb.isPartOf(each) || tmb.beginsWith(each) || tmb.endsWith(each);
          if (result)
            break;
        }
      }
    }
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.