Package org.apache.uima.cas

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


    // iterate
    while (iter.isValid()) {
      FeatureStructure fs = iter.get();
      printFS(fs, aCAS, 0, aOut);
      iter.moveToNext();
    }
  }

  /**
   * Prints all Annotations of a specified Type to a PrintStream.
View Full Code Here


      // iterate over annotations and add them to an ArrayList
      List annotationList = new ArrayList();
      while (iterator.isValid()) {
        annotationList.add(iterator.get());
        iterator.moveToNext();
      }

      // For each Annotation in the list, add its start and end
      // positions to the result array.
      int numRanges = annotationList.size();
View Full Code Here

          // Get begin position of this annotation
          int annotBegin = annot.getBegin();
          // search for matches within this
          annotateRange(aCAS, coveredText, annotBegin);
          // Advance the iterator.
          it.moveToNext();
        }
      }
    } catch (Exception e) {
      throw new AnalysisEngineProcessException(e);
    }
View Full Code Here

    // and print out all annotations found
    System.out.println("---Printing all annotations for English Sofa---");
    while (anIter.isValid()) {
      AnnotationFS annot = (AnnotationFS) anIter.get();
      System.out.println(" " + annot.getType().getName() + ": " + annot.getCoveredText());
      anIter.moveToNext();
    }

    // now try to get the CAS view for the German Sofa
    System.out.println();
    CAS germanView = cas.getView("GermanDocument");
View Full Code Here

      System.out.println(" " + annot.getType().getName() + ": " + annot.getCoveredText());
      if (annot.getType() == cross) {
        AnnotationFS crossAnnot = (AnnotationFS) annot.getFeatureValue(other);
        System.out.println("   other annotation feature: " + crossAnnot.getCoveredText());
      }
      anIter.moveToNext();
    }

    // Clean up
    seAnnotator.destroy();
  }
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.moveToNext();
    if (!subiterator.isValid())
      subiterator.moveTo(focus);

    while (scopeContextAnnotations.size() < leftScopeSize) {
      subiterator.moveToPrevious();
View Full Code Here

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

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

      while (iterator.isValid()) {
        FeatureStructure fs = iterator.get();
        if (fs instanceof AnnotationFS) {
          result.add((AnnotationFS) fs);
        }
        iterator.moveToNext();
      }
    }
    return result;
  }
View Full Code Here

      while (iterator.isValid()) {
        FeatureStructure fs = iterator.get();
        if (fs instanceof AnnotationFS) {
          result.add((AnnotationFS) fs);
        }
        iterator.moveToNext();
      }
    }
    return result;
  }
View Full Code Here

      while (iterator.isValid()) {
        FeatureStructure fs = iterator.get();
        if (fs instanceof AnnotationFS) {
          result.add((AnnotationFS) fs);
        }
        iterator.moveToNext();
      }
    }
    return result;
  }
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.