Examples of subiterator()


Examples of org.apache.uima.cas.text.AnnotationIndex.subiterator()

    jcas.setDocumentText(text);
    try {
      this.ae.process(jcas);
      AnnotationIndex tokenIndex = jcas.getAnnotationIndex(jcas.getCasType(Token.type));
      AnnotationFS sentence = (AnnotationFS) jcas.getAnnotationIndex(jcas.getCasType(Sentence.type)).iterator().next();
      FSIterator tokenIterator = tokenIndex.subiterator(sentence);
      AnnotationFS token = (AnnotationFS) tokenIndex.iterator().next();
      tokenIterator.moveTo(token); //throws ClassCastException   
    } catch (AnalysisEngineProcessException e) {
      e.printStackTrace();
      assertTrue(false);
View Full Code Here

Examples of org.apache.uima.cas.text.AnnotationIndex.subiterator()

      Sentence sentence = (Sentence) sentences.next();

      tokens.clear();
      words.clear();

      FSIterator tokenIterator = baseTokenIndex.subiterator(sentence);
      while (tokenIterator.hasNext()) {
        BaseToken token = (BaseToken) tokenIterator.next();
        tokens.add(token);
        words.add(token.getCoveredText());
      }
View Full Code Here

Examples of org.apache.uima.cas.text.AnnotationIndex.subiterator()

      it.moveToNext();
    }
    assertTrue(count == 1);
    // System.out.println("Size of unambiguous iterator: " + count);
    AnnotationFS bigAnnot = this.cas.createAnnotation(this.sentenceType, 10, 41);
    it = annotIndex.subiterator(bigAnnot, true, true);
    count = 0;
    while (it.isValid()) {
      ++count;
      // AnnotationFS a = (AnnotationFS) it.get();
      // System.out.println("Annotation from " + a.getBegin() + " to " + a.getEnd());
View Full Code Here

Examples of org.apache.uima.cas.text.AnnotationIndex.subiterator()

    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);
    count = 0;
    while (it.isValid()) {
      ++count;
      // AnnotationFS a = (AnnotationFS) it.get();
      // System.out.println("Annotation from " + a.getBegin() + " to " + a.getEnd());
View Full Code Here

Examples of org.apache.uima.cas.text.AnnotationIndex.subiterator()

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

Examples of org.apache.uima.cas.text.AnnotationIndex.subiterator()

    count = 0;
    for (it.moveToLast(); it.isValid(); it.moveToPrevious()) {
      ++count;
    }
    assertTrue(count == 39);
    it = annotIndex.subiterator(bigAnnot, false, false);
    count = 0;
    while (it.isValid()) {
      ++count;
      // AnnotationFS a = (AnnotationFS) it.get();
      // System.out.println("Annotation from " + a.getBegin() + " to " + a.getEnd());
View Full Code Here

Examples of org.apache.uima.cas.text.AnnotationIndex.subiterator()

    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);
    count = 0;
    while (it.isValid()) {
      ++count;
      // AnnotationFS a = (AnnotationFS) it.get();
      // System.out.println("Annotation from " + a.getBegin() + " to " + a.getEnd());
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.