Examples of moveToNext()


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

      SofaFS sofa;
      FSIterator sItr = cas.getSofaIterator();
      while (sItr.isValid()) {
        sofa = (SofaFS) sItr.get();
        totalAnnots += cas.getView(sofa).getAnnotationIndex().size();
        sItr.moveToNext();
      }
      UIMAFramework.getLogger().log(Level.FINE, "CAS Annotation Count::" + totalAnnots);

      return responseFrame;
    } catch (Throwable ex) {
View Full Code Here

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

          // 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

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

      SofaFS sofa;
      FSIterator sItr = cas.getSofaIterator();
      while (sItr.isValid()) {
        sofa = (SofaFS) sItr.get();
        totalAnnots += cas.getView(sofa).getAnnotationIndex().size();
        sItr.moveToNext();
      }
      UIMAFramework.getLogger().log(Level.FINEST, "CAS ACount::" + totalAnnots);
      ct.setCommand(null);
      return ct;
    } catch (Exception ex) {
View Full Code Here

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

      while (iter.isValid()) {
        if (iter.get().getType() == subtypeHandle) // expected
          break;
        if (iter.get().getType() == supertypeHandle) // unexpected
          fail();
        iter.moveToNext();
      }

      // test that passing an invalid object causes an error
      descList.add(new ConfigurationParameter_impl());
      try {
View Full Code Here

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

            + index.getType().getName() + "</font> [" + size + "]</html>";
    this.root = new FSNode(this, FSNode.DISPLAY_NODE, 0, null);
    this.fss = new ArrayList<FSNode>();
    FSIterator it = index.iterator();
    int count = 0;
    for (it.moveToFirst(); it.isValid(); it.moveToNext()) {
      FeatureStructure fs = it.get();
      this.fss.add(new FSNode(this, getNodeType(fs.getType()), fs.hashCode(), count));
      ++count;
    }
    List<FSTreeNode> kids = createArrayChildren(0, size, this.fss, this);
View Full Code Here

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

      FSIndex frIndex = indexes.getAnnotationIndex(Annotation.type);
      FSIterator sofaIter = jcas.getSofaIterator();
      int numSofas = 0;
      while (sofaIter.isValid()) {
        numSofas++;
        sofaIter.moveToNext();
      }
      // assertTrue(sofaIndex.size() == 3); // 3 sofas
      assertTrue(numSofas == 3);
      assertTrue(engIndex.size() == 5); // 4 annots plus documentAnnotation
      assertTrue(gerIndex.size() == 5); // 4 annots plus documentAnnotation
View Full Code Here

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

      assertTrue((CAS.TYPE_NAME_DOCUMENT_ANNOTATION).equals(gerAnnot.getType().getName()));
      assertTrue((CAS.TYPE_NAME_DOCUMENT_ANNOTATION).equals(frAnnot.getType().getName()));

      engIt.moveToNext();
      gerIt.moveToNext();
      frIt.moveToNext();
      engAnnot = (Annotation) engIt.get();
      CrossAnnotation gerCrossAnnot = (CrossAnnotation) gerIt.get();
      frAnnot = (Annotation) frIt.get();
      assertTrue((CAS.TYPE_NAME_ANNOTATION).equals(engAnnot.getType().getName()));
      assertTrue(("this").equals(engAnnot.getCoveredText()));
View Full Code Here

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

    FSIndex anIndex = englishView.getAnnotationIndex();
    FSIterator anIter = anIndex.iterator();
    Assert.assertEquals("this beer is good", ((AnnotationFS) anIter.next()).getCoveredText());
    Assert.assertEquals("this", ((AnnotationFS) anIter.next()).getCoveredText());
    if ("this".equals(((AnnotationFS) anIter.get()).getCoveredText()))
      anIter.moveToNext(); // because sometimes the test case runs 2 copies of the TransAnnotator
    Assert.assertEquals("beer", ((AnnotationFS) anIter.next()).getCoveredText());
    if ("beer".equals(((AnnotationFS) anIter.get()).getCoveredText()))
      anIter.moveToNext();
    Assert.assertEquals("is", ((AnnotationFS) anIter.next()).getCoveredText());
    if ("is".equals(((AnnotationFS) anIter.get()).getCoveredText()))
View Full Code Here

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

    Assert.assertEquals("this", ((AnnotationFS) anIter.next()).getCoveredText());
    if ("this".equals(((AnnotationFS) anIter.get()).getCoveredText()))
      anIter.moveToNext(); // because sometimes the test case runs 2 copies of the TransAnnotator
    Assert.assertEquals("beer", ((AnnotationFS) anIter.next()).getCoveredText());
    if ("beer".equals(((AnnotationFS) anIter.get()).getCoveredText()))
      anIter.moveToNext();
    Assert.assertEquals("is", ((AnnotationFS) anIter.next()).getCoveredText());
    if ("is".equals(((AnnotationFS) anIter.get()).getCoveredText()))
      anIter.moveToNext();
    Assert.assertEquals("good", ((AnnotationFS) anIter.next()).getCoveredText());
    if (anIter.isValid() && "good".equals(((AnnotationFS) anIter.get()).getCoveredText()))
View Full Code Here

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

    Assert.assertEquals("beer", ((AnnotationFS) anIter.next()).getCoveredText());
    if ("beer".equals(((AnnotationFS) anIter.get()).getCoveredText()))
      anIter.moveToNext();
    Assert.assertEquals("is", ((AnnotationFS) anIter.next()).getCoveredText());
    if ("is".equals(((AnnotationFS) anIter.get()).getCoveredText()))
      anIter.moveToNext();
    Assert.assertEquals("good", ((AnnotationFS) anIter.next()).getCoveredText());
    if (anIter.isValid() && "good".equals(((AnnotationFS) anIter.get()).getCoveredText()))
      anIter.moveToNext();
    Assert.assertFalse(anIter.hasNext());
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.