Examples of JFSIndexRepository


Examples of org.apache.uima.jcas.JFSIndexRepository

   */
  public void process(JCas jcas) throws AnalysisEngineProcessException {
    removeList.clear();

    // iterate over source objects in JCas
    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    FSIterator<Annotation> srcObjItr = indexes.getAnnotationIndex(
        retainAnnType).iterator();

    while (srcObjItr.hasNext()) {
      Annotation ann = (Annotation) srcObjItr.next();
      if (!isValid(ann))
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

    sentenceCount = 0;

    String text = jcas.getDocumentText();

    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    Iterator<?> sectionItr = indexes.getAnnotationIndex(Segment.type)
        .iterator();
    while (sectionItr.hasNext()) {
      Segment sa = (Segment) sectionItr.next();
      String sectionID = sa.getId();
      if (!skipSegmentsSet.contains(sectionID)) {
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

  public Iterator getLookupTokenIterator(JCas jcas)
      throws AnnotatorInitializationException
  {
    List ltList = new ArrayList();

    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    Iterator btaItr = indexes.getAnnotationIndex(BaseToken.type)
        .iterator();
    while (btaItr.hasNext())
    {
      BaseToken bta = (BaseToken) btaItr.next();
      if (!((bta instanceof NewlineToken)
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

  }

  public Iterator getLookupWindowIterator(JCas jcas)
      throws AnnotatorInitializationException
  {
    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    return indexes.getAnnotationIndex(Sentence.type).iterator();
  }
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

  public Iterator getLookupTokenIterator(JCas jcas)
      throws AnnotatorInitializationException
  {
    List ltList = new ArrayList();

    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    Iterator btaItr = indexes.getAnnotationIndex(BaseToken.type).iterator();
    while (btaItr.hasNext())
    {
      BaseToken bta = (BaseToken) btaItr.next();
      if (!((bta instanceof NewlineToken)
          || (bta instanceof PunctuationToken)
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

  public Iterator getLookupWindowIterator(JCas jcas)
      throws AnnotatorInitializationException
  {
    try
    {
      JFSIndexRepository indexes = jcas.getJFSIndexRepository();
      String objClassName = iv_props.getProperty(WINDOW_ANNOT_PRP_KEY);
      int windowType = JCasUtil.getType(objClassName);
      return indexes.getAnnotationIndex(windowType).iterator();
    }
    catch (Exception e)
    {
      throw new AnnotatorInitializationException(e);
    }
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

    if (iv_annotTypeArr != null)
    {
      List list = new ArrayList();

      // algorithm depends on a window for permutations
      JFSIndexRepository indexes = jcas.getJFSIndexRepository();
      for (int i = 0; i < iv_annotTypeArr.length; i++)
      {
        Iterator itr = indexes.getAnnotationIndex(iv_annotTypeArr[i])
            .iterator();
        list.addAll(constrainToWindow(windowBegin, windowEnd, itr));
      }

      Map m = new HashMap();
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
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.