Package org.apache.uima.cas

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


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

  private List<WhiskRuleItem> getTermsBefore(WhiskRuleItem whiskRuleItem, TextRulerExample example) {
View Full Code Here


            firstBegin = a.getBegin();
          }
          if (a.getBegin() == firstBegin)
            startAs.add(a);
        }
        iterator.moveToNext();
      } else {
        iterator.moveToNext();
      }
    }
View Full Code Here

          if (a.getBegin() == firstBegin)
            startAs.add(a);
        }
        iterator.moveToNext();
      } else {
        iterator.moveToNext();
      }
    }

    for (AnnotationFS annotation : startAs) {
      List<WhiskRuleItem> startList = new ArrayList<WhiskRuleItem>();
View Full Code Here

      if (a.getBegin() >= begin && a.getEnd() <= end) {
        if (!filterSetWithSlotNames.contains(a.getType().getName())) {
          return false;
        }
      }
      iterator.moveToNext();
    }
    return true;
  }
}
View Full Code Here

  private List<String> getCurrentTagList(JCas cas) {
    List<String> tagList = new ArrayList<String>();
    AnnotationIndex tokenIndex = cas.getAnnotationIndex(TokenAnnotation.type);
    FSIterator tokIt = tokenIndex.iterator();
    TokenAnnotation token = null;
    for (tokIt.moveToFirst(); tokIt.isValid(); tokIt.moveToNext()) {
      token = (TokenAnnotation) tokIt.get();
      tagList.add(token.getPosTag());
    }
    return tagList;
  }
View Full Code Here

    Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(
        "moby-tag-list.txt"), "utf-8"));
    AnnotationIndex tokenIndex = cas.getAnnotationIndex(TokenAnnotation.type);
    FSIterator tokIt = tokenIndex.iterator();
    TokenAnnotation token = null;
    for (tokIt.moveToFirst(); tokIt.isValid(); tokIt.moveToNext()) {
      token = (TokenAnnotation) tokIt.get();
      writer.write(token.getPosTag());
      writer.write('\n');
    }
    writer.close();
View Full Code Here

            } catch (StringIndexOutOfBoundsException e) {
              System.err.println("Invalid annotation range: " + nextAnnot.getBegin() + ","
                      + nextAnnot.getEnd() + " in document of length " + docText.length());
            }
          }
          iterator.moveToNext();
        } else {
          // nextAnnot begins after curAnnot ends
          // write text between current pos and end of curAnnot
          try {
            handler.characters(docCharArray, pos, curAnnot.getEnd() - pos);
View Full Code Here

      // cas.getIndexRepository().getIndex(CAS.SOFA_INDEX_NAME);
      FSIterator sofaIter =this.cas.getSofaIterator();
      int numSofas = 0;
      while (sofaIter.isValid()) {
        numSofas++;
        sofaIter.moveToNext();
      }
      FSIndex engIndex = engTcas.getAnnotationIndex();
      FSIndex gerIndex = gerTcas.getAnnotationIndex();
      FSIndex frIndex = frTcas.getAnnotationIndex();
      // assertTrue(sofaIndex.size() == 3); // 3 sofas
View Full Code Here

      assertTrue(docAnnotationType.getName().equals(gerAnnot.getType().getName()));
      assertTrue(docAnnotationType.getName().equals(frAnnot.getType().getName()));

      engIt.moveToNext();
      gerIt.moveToNext();
      frIt.moveToNext();
      engAnnot = (AnnotationFS) engIt.get();
      gerAnnot = (AnnotationFS) gerIt.get();
      frAnnot = (AnnotationFS) frIt.get();
      assertTrue(annotationType.getName().equals(engAnnot.getType().getName()));
      assertTrue(("this").equals(engAnnot.getCoveredText()));
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.