Package org.apache.uima.cas

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


      try {

        while (it.isValid()) {
          Object o = it.get();
          assertTrue(o instanceof Annotation);
          it.moveToNext();
        }
      } catch (Exception e) {
        System.out.println("failed: nonJCasCovered by JCas");
      }
    } catch (Exception e) {
View Full Code Here


      SofaFS sofa = (SofaFS) iterator.get();
      if (sofaName.equals(getStringValue(((FeatureStructureImpl) sofa).getAddress(),
          this.svd.casMetadata.ts.sofaIdFeatCode))) {
        return sofa;
      }
      iterator.moveToNext();
    }
    CASRuntimeException e = new CASRuntimeException(CASRuntimeException.SOFANAME_NOT_FOUND,
        new String[] { sofaName });
    throw e;
  }
View Full Code Here

      // next line the getView as a side effect
      // checks for dupl sofa name, and if not,
      // adds the name to the sofaNameSet
      ((CASImpl) this.getView(sofa)).registerView(sofa);

      iterator.moveToNext();
    }
    this.svd.viewCount = numViews; // total number of views
    for (int viewNbr = 1; viewNbr <= numViews; viewNbr++) {
      CAS view = (viewNbr == 1) ? getInitialView() : getView(viewNbr);
      if (view != null) {
View Full Code Here

        // If not, skip.
        continue;
      }
      // Iterate over FSs, filter and create output.
      FSIterator iterator = cas.getAnnotationIndex(type).iterator();
      for (; iterator.isValid(); iterator.moveToNext()) {
        AnnotationFS annotation = (AnnotationFS) iterator.get();
        Filter filter = tspec.getFilter();
        // Check that there either is no filter, or the FS passes the filter.
        if ((filter == null) || filter.match(annotation)) {
          // Create a new result entry, fill with attributes and add result set.
View Full Code Here

  private void outputAll(CAS cas, List<ResultEntry> resultEntries) {
    checkCreateDefaultMap(cas.getTypeSystem());
    // Output everything except the document annotation.
    Type docAnnotationType = cas.getTypeSystem().getType(CAS.TYPE_NAME_DOCUMENT_ANNOTATION);
    FSIterator it = cas.getAnnotationIndex().iterator();
    for (it.moveToFirst(); it.isValid(); it.moveToNext()) {
      AnnotationFS annot = (AnnotationFS) it.get();
      if (annot.getType().equals(docAnnotationType)) {
        // Skip the document annotation
        continue;
      }
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

      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

          uimaMeetings.add(annot);
          break;
        }
      }

      iter.moveToNext();
    }

    Iterator uimaMeetingIter = uimaMeetings.iterator();
    while (uimaMeetingIter.hasNext()) {
      UimaMeeting annot = (UimaMeeting) uimaMeetingIter.next();
View Full Code Here

    // iterate
    while (iter.isValid()) {
      FeatureStructure fs = iter.get();
      printFS(fs, aCAS, 0, aOut);
      iter.moveToNext();
    }
  }

  /**
   * Prints a FeatureStructure to a PrintStream.
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.