Package org.apache.uima.cas

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


  public static FeatureStructure getTcasFS(CAS aCasView, String aTypeS) {
    org.apache.uima.cas.FeatureStructure idFS = null;
    FSIterator idIter = aCasView.getAnnotationIndex(aCasView.getTypeSystem().getType(aTypeS)).iterator();
    while (idIter != null && idIter.isValid()) {
      idFS = idIter.get();
      idIter.moveToNext();
    }
    return idFS;
  }

}
View Full Code Here


      JFSIndexRepository jfsi = jcas.getJFSIndexRepository();
      FSIndex fsi1 = jfsi.getIndex("all", Root.type);
      FSIterator fsit1 = fsi1.iterator();
      assertTrue(fsit1.isValid());
      assertTrue(r2 == fsit1.get());
      fsit1.moveToNext();
      assertTrue(fsit1.isValid());
      assertTrue(r1 == fsit1.get());
      /*
       * while (fsit1.isValid()) { System.out.println("Iterator getting: " +
       * fsit1.get().toString()); fsit1.moveToNext(); }
View Full Code Here

      FSIterator it = jir.getIndex("all", Root.type).iterator();
      // System.out.print("\nTesting Random: ");
      while (it.isValid()) {
        root1.test(it.get());
        // System.out.print("t");
        it.moveToNext();
      }
    } catch (Exception e) {
      JUnitExtension.handleException(e);
    }
  }
View Full Code Here

      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

    int result = 0;
    FSIterator idIter = aCasView.getAnnotationIndex(aCasView.getTypeSystem().getType(aTypeS)).iterator();
    while (idIter != null && idIter.isValid()) {
      org.apache.uima.cas.FeatureStructure idFS = idIter.get();
      result = idFS.getIntValue(aCasView.getTypeSystem().getFeatureByFullName(aTypeS + ":" + aFeatS));
      idIter.moveToNext();
    }
    return result;
  }

  /**
 
View Full Code Here

            .iterator();
    while (idIter != null && idIter.isValid()) {
      org.apache.uima.cas.FeatureStructure idFS = idIter.get();
      result = idFS.getStringValue(aCasView.getTypeSystem().getFeatureByFullName(
              aTypeS + ":" + aFeatS));
      idIter.moveToNext();
    }
    return result;
  }

  /**
 
View Full Code Here

  public static FeatureStructure getTcasFS(CAS aCasView, String aTypeS) {
    org.apache.uima.cas.FeatureStructure idFS = null;
    FSIterator idIter = aCasView.getAnnotationIndex(aCasView.getTypeSystem().getType(aTypeS)).iterator();
    while (idIter != null && idIter.isValid()) {
      idFS = idIter.get();
      idIter.moveToNext();
    }
    return idFS;
  }

}
View Full Code Here

      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

      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

    FSIterator iter = mCAS.getAnnotationIndex().iterator();
    Hashtable checkBoxes = new Hashtable();
    HashSet checkBoxesDone = new HashSet();
    while (iter.isValid()) {
      AnnotationFS fs = (AnnotationFS) iter.get();
      iter.moveToNext();

      Type type = fs.getType();

      // have we seen this type before?
      JCheckBox checkbox = (JCheckBox) mTypeToCheckboxMap.get(type);
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.