Examples of JFSIndexRepository


Examples of org.apache.uima.jcas.JFSIndexRepository

      Annotation a1 = new Annotation(jcas);
      a1.addToIndexes();
      FeatureStructure f1 = localCas.createFS(subTok);
      localCas.getIndexRepository().addFS(f1);

      JFSIndexRepository ir = jcas.getJFSIndexRepository();
      FSIndex index = ir.getAnnotationIndex();
      FSIterator it = index.iterator();

      try {

        while (it.isValid()) {
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

        gerAnnot.setOtherAnnotation(engAnnot);
        gerAnnot.addToIndexes();
      }

      // Test that the annotations are in separate index spaces, and that Sofas are indexed
      JFSIndexRepository indexes = jcas.getJFSIndexRepository();
      // FSIndex sofaIndex = indexes.getIndex(CAS.SOFA_INDEX_NAME);
      indexes = engJcas.getJFSIndexRepository();
      FSIndex engIndex = indexes.getAnnotationIndex(Annotation.type);
      indexes = gerJcas.getJFSIndexRepository();
      FSIndex gerIndex = indexes.getAnnotationIndex(Annotation.type);
      indexes = frJcas.getJFSIndexRepository();
      FSIndex frIndex = indexes.getAnnotationIndex(Annotation.type);
      FSIterator sofaIter = jcas.getSofaIterator();
      int numSofas = 0;
      while (sofaIter.isValid()) {
        numSofas++;
        sofaIter.moveToNext();
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

  public void testIteratorCopy() {
    Annotation something = new Annotation(jcas);
    something.addToIndexes();

    JFSIndexRepository ir = jcas.getJFSIndexRepository();
    FSIterator i1 = ir.getAnnotationIndex().iterator();
    FSIterator i2 = i1.copy();
    FSIterator i3 = i2.copy();
    assertTrue(i3 != null);
  }
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

      assertTrue(null == r2.getArrayRef());

      r2.addToIndexes();
      r1.addToIndexes();

      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());
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

      // System.out.print("Making Random: ");
      for (int i = 0; i < 50; i++) {
        root1.make();
        // System.out.print("m");
      }
      JFSIndexRepository jir = jcas.getJFSIndexRepository();
      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();
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

      Annotation a1 = new Annotation(jcas);
      a1.addToIndexes();
      FeatureStructure f1 = localCas.createFS(subTok);
      localCas.getIndexRepository().addFS(f1);

      JFSIndexRepository ir = jcas.getJFSIndexRepository();
      FSIndex index = ir.getAnnotationIndex();
      FSIterator it = index.iterator();

      try {

        while (it.isValid()) {
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

    * {@inheritDoc}
    */
   @Override
   public void process( final JCas jcas ) throws AnalysisEngineProcessException {
      _logger.info( "Starting processing" );
      final JFSIndexRepository indexes = jcas.getJFSIndexRepository();
      final AnnotationIndex annotationIndex = indexes.getAnnotationIndex( _lookupWindowType );
      if ( annotationIndex == null ) {  // I don't trust AnnotationIndex.size(), so don't check
         return;
      }
      final Map<RareWordDictionary,Collection<SpannedRareWordTerm>> dictionaryTermsMap
            = new HashMap<RareWordDictionary, Collection<SpannedRareWordTerm>>();
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

    iv_logger.info("process(JCas)");

    try
    {
      JFSIndexRepository indexes = jcas.getJFSIndexRepository();
      FSIterator segmentItr = indexes.getAnnotationIndex(Segment.type).iterator();
      FSIterator baseTokenItr = indexes.getAnnotationIndex(BaseToken.type).iterator();

      List<org.apache.ctakes.core.fsm.token.BaseToken> baseTokenList = new ArrayList<org.apache.ctakes.core.fsm.token.BaseToken>();
      while (baseTokenItr.hasNext())
      {
        BaseToken bta = (BaseToken) baseTokenItr.next();
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

    return -1;// screams error!
  }

  private Segment getSegmentContainingOffsets(JCas jcas, int start, int end)
  {
    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    Iterator segmentItr = indexes.getAnnotationIndex(Segment.type).iterator();

    while (segmentItr.hasNext())
    {
      Segment seg = (Segment) segmentItr.next();
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

        boolean statusFound = false;
        if (!keepNoChangeStatus) {
          // All entries may not be appropriate, so some
          // filtering
          // may need to be implemented here
          JFSIndexRepository indexes = jcas.getJFSIndexRepository();
          Iterator subSectionItr = indexes.getAnnotationIndex(
              SubSectionAnnotation.type).iterator();

          String statusKey = null;
          while (subSectionItr.hasNext() && !statusFound)
          {
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.