Package org.apache.uima.cas

Examples of org.apache.uima.cas.FSIterator.moveToPrevious()


    subiterator.moveToNext();
    if (!subiterator.isValid())
      subiterator.moveTo(focus);

    while (scopeContextAnnotations.size() < leftScopeSize) {
      subiterator.moveToPrevious();
      if (subiterator.isValid()) {
        Annotation contextAnnotation = (Annotation) subiterator.get();
        if (contextAnnotation.getEnd() > focus.getBegin()) {
          continue;
        }
View Full Code Here


    if (focus.getBegin() < window.getBegin() || focus.getEnd() > window.getEnd())
      return scopeContextAnnotations;

    FSIterator subiterator = jCas.getAnnotationIndex(contextType).subiterator(window);
    subiterator.moveTo(focus);
    subiterator.moveToPrevious();
    if (!subiterator.isValid())
      subiterator.moveTo(focus);

    while (scopeContextAnnotations.size() < rightScopeSize) {
      subiterator.moveToNext();
View Full Code Here

    AnnotationFS pointer = cas.createAnnotation(frameType, begin, begin);
    FSIterator iterator = cas.getAnnotationIndex().iterator(pointer);
    int nextEnd = -1;

    // ???
    iterator.moveToPrevious();
    iterator.moveToPrevious();
    while (iterator.isValid()) {
      FeatureStructure fs = iterator.get();
      if (fs instanceof AnnotationFS) {
        AnnotationFS a = (AnnotationFS) fs;
View Full Code Here

    FSIterator iterator = cas.getAnnotationIndex().iterator(pointer);
    int nextEnd = -1;

    // ???
    iterator.moveToPrevious();
    iterator.moveToPrevious();
    while (iterator.isValid()) {
      FeatureStructure fs = iterator.get();
      if (fs instanceof AnnotationFS) {
        AnnotationFS a = (AnnotationFS) fs;
        if (!filterSetWithSlotNames.contains(a.getType().getName())) {
View Full Code Here

      FeatureStructure fs = iterator.get();
      if (fs instanceof AnnotationFS) {
        AnnotationFS a = (AnnotationFS) fs;
        if (!filterSetWithSlotNames.contains(a.getType().getName())) {
          if (a.getEnd() > example.getAnnotation().getEnd()) {
            iterator.moveToPrevious();
            continue;
          }
          if (nextEnd == -1) {
            nextEnd = a.getEnd();
          }
View Full Code Here

                    new TextRulerAnnotation(a, example.getDocument()));
            result.add(term);
          }
        }
      }
      iterator.moveToPrevious();
    }
    return result;
  }

  public String getResultString() {
View Full Code Here

      // System.out.println("Annotation from " + a.getBegin() + " to " + a.getEnd());
      it.moveToNext();
    }
    assertTrue(count == 32);
    count = 0;
    for (it.moveToLast(); it.isValid(); it.moveToPrevious()) {
      ++count;
    }
    assertTrue(count == 32);
    // System.out.println("Size of subiterator(true, true): " + count);
    it = annotIndex.subiterator(bigAnnot, false, true);
View Full Code Here

      it.moveToNext();
    }
    assertTrue(count == 3);
    // System.out.println("Size of subiterator(false, true): " + count);
    count = 0;
    for (it.moveToLast(); it.isValid(); it.moveToPrevious()) {
      ++count;
    }
    assertTrue(count == 3);
    it = annotIndex.subiterator(bigAnnot, true, false);
    count = 0;
View Full Code Here

      it.moveToNext();
    }
    assertTrue(count == 39);
    // System.out.println("Size of subiterator(true, false): " + count);
    count = 0;
    for (it.moveToLast(); it.isValid(); it.moveToPrevious()) {
      ++count;
    }
    assertTrue(count == 39);
    it = annotIndex.subiterator(bigAnnot, false, false);
    count = 0;
View Full Code Here

      it.moveToNext();
    }
    assertTrue(count == 4);
    // System.out.println("Size of subiterator(false, false): " + count);
    count = 0;
    for (it.moveToLast(); it.isValid(); it.moveToPrevious()) {
      ++count;
    }
    assertTrue(count == 4);
    AnnotationFS sent = (AnnotationFS) this.cas.getAnnotationIndex(this.sentenceType).iterator().get();
    it = annotIndex.subiterator(sent, false, true);
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.