Package org.apache.uima.cas

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


    // Remove all annotations.
    for (int i = 0; i < fsArray.length; i++) {
      ir.removeFS(fsArray[i]);
    }
    // All iterators should be invalidated when being reset.
    bagIt.moveToFirst();
    assertFalse(bagIt.isValid());
    setIt.moveToFirst();
    assertFalse(setIt.isValid());
    sortedIt.moveToFirst();
    assertFalse(sortedIt.isValid());
View Full Code Here


  public synchronized void processCas(CAS aCAS) throws ResourceProcessException {
    try {
      // iterate and print annotations
      FSIterator typeIterator = aCAS.getCurrentView().getAnnotationIndex().iterator();

      for (typeIterator.moveToFirst(); typeIterator.isValid(); typeIterator.moveToNext()) {
        AnnotationFS annot = (AnnotationFS) typeIterator.get();

        this.fileWriter.write(annot.getCoveredText());
        this.fileWriter.write(System.getProperty("line.separator"));
        this.fileWriter.write(annot.toString());
View Full Code Here

  }

  private static final int countIndexMembers(FSIndex idx) {
    FSIterator it = idx.iterator();
    int count = 0;
    for (it.moveToFirst(); it.isValid(); it.moveToNext()) {
      ++count;
    }
    return count;
  }
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.