Package org.apache.uima.cas.text

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


    while (sentences.hasNext()) {
      Sentence sentence = (Sentence) sentences.next();

      tokens.clear();

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


      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

    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

    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

    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

    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

      AnnotationIndex baseTokenIndex = jcas.getJFSIndexRepository().getAnnotationIndex(
          org.apache.ctakes.typesystem.type.syntax.BaseToken.type);
     
      while (sentItr.hasNext()) {
        Sentence sentAnnot = (Sentence) sentItr.next();
        FSIterator btaItr = baseTokenIndex.subiterator(sentAnnot);

        // adapt JCas objects into objects expected by the Finite state
        // machines
        List<BaseToken> baseTokenList = new ArrayList<BaseToken>();
        while (btaItr.hasNext()) {
View Full Code Here

      sentenceBuffer.setLength(0);

      int mapIdx = 0;

      // iterate over Tokens
      FSIterator tokenIterator = tokenIndex.subiterator(sentence);
      while (tokenIterator.hasNext()) {
        Token token = (Token) tokenIterator.next();

        String word = escapeToken(token.getCoveredText());
View Full Code Here

      tokenList.clear();
      wordList.clear();

      // iterate over Tokens
      FSIterator tokenIterator = tokenIndex.subiterator(sentence);
      while (tokenIterator.hasNext()) {
        Token token = (Token) tokenIterator.next();

        tokenList.add(token);
        wordList.add(token.getCoveredText());
View Full Code Here

      tokenList.clear();
      wordList.clear();

      // iterate over Tokens
      FSIterator tokenIterator = tokenIndex.subiterator(sentence);
      while (tokenIterator.hasNext()) {
        Token token = (Token) tokenIterator.next();

        tokenList.add(token);
        wordList.add(token.getCoveredText());
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.