Examples of addToIndexes()


Examples of org.apache.uima.examples.opennlp.EntityAnnotation.addToIndexes()

      EntityAnnotation entityAnnot = (EntityAnnotation) annotationMaker
              .newInstance(new Object[] { jCas });
      entityAnnot.setBegin(start);
      entityAnnot.setEnd(end);
      entityAnnot.setComponentId(COMPONENT_NAME);
      entityAnnot.addToIndexes();
    } catch (Exception e) {
      throw new AnalysisEngineProcessException(e);
    }
  }
}
View Full Code Here

Examples of org.apache.uima.examples.opennlp.Sentence.addToIndexes()

    int sentenceOffsets[] = sentenceDetector.sentPosDetect(docText);
    int begin = 0;
    for (int i = 0; i < sentenceOffsets.length; i++) {
      Sentence sentence = new Sentence(aJCas, begin, sentenceOffsets[i]);
      sentence.setComponentId(COMPONENT_ID);
      sentence.addToIndexes();
      begin = sentenceOffsets[i];
    }
  }

}
View Full Code Here

Examples of org.apache.uima.examples.opennlp.SyntaxAnnotation.addToIndexes()

          throw new AnalysisEngineProcessException(e);
        }
        syntaxAnnot.setBegin(start);
        syntaxAnnot.setEnd(end);
        syntaxAnnot.setComponentId(COMPONENT_NAME);
        syntaxAnnot.addToIndexes();
      }
      Parse[] children = parse.getChildren();
      for (int i = 0; i < children.length; i++) {
        makeAnnotations(children[i], jCas);
      }
View Full Code Here

Examples of org.apache.uima.examples.opennlp.Token.addToIndexes()

        Span span = tokenSpans[i];
        Token token = new Token(aJCas);
        token.setBegin(sentence.getBegin() + span.getStart());
        token.setEnd(sentence.getBegin() + span.getEnd());
        token.setComponentId(COMPONENT_ID);
        token.addToIndexes();
      }
    }

  }
}
View Full Code Here

Examples of org.apache.uima.fit.examples.tutorial.type.RoomNumber.addToIndexes()

      Matcher matcher = mPatterns[i].matcher(docText);
      while (matcher.find()) {
        // found one - create annotation
        RoomNumber annotation = new RoomNumber(aJCas, matcher.start(), matcher.end());
        annotation.setBuilding(mLocations[i]);
        annotation.addToIndexes();
        getContext().getLogger().log(Level.FINEST, "Found: " + annotation);
      }
    }
  }
}
View Full Code Here

Examples of org.apache.uima.fit.examples.tutorial.type.UimaAcronym.addToIndexes()

      String expandedForm = acronymTable.get(token);
      if (expandedForm != null) {
        // create annotation
        UimaAcronym annot = new UimaAcronym(aJCas, pos, pos + token.length());
        annot.setExpandedForm(expandedForm);
        annot.addToIndexes();
      }
      // incrememnt pos and go to next token
      pos += token.length();
    }
  }
View Full Code Here

Examples of org.apache.uima.fit.examples.type.Token.addToIndexes()

      goldView.setDocumentText(text.toString().trim());
      new Sentence(goldView, 0, goldView.getDocumentText().length()).addToIndexes();

      for (Token token : tokens) {
        token.addToIndexes();
      }
    } catch (CASException ce) {
      throw new AnalysisEngineProcessException(ce);
    }
  }
View Full Code Here

Examples of org.apache.uima.fit.type.AnalyzedText.addToIndexes()

  private static AnalyzedText _getAnalyzedText(JCas jCas) {
    AnalyzedText analyzedText = JCasUtil.selectByIndex(jCas, AnalyzedText.class, 0);
    if (analyzedText == null) {
      analyzedText = new AnalyzedText(jCas);
      analyzedText.setText(jCas.getDocumentText());
      analyzedText.addToIndexes();
    }
    return analyzedText;
  }
}
View Full Code Here

Examples of org.apache.uima.fit.type.Sentence.addToIndexes()

    Token token2 = new Token(jcas, 3, 4);
    token2.addToIndexes();
    token2.addToIndexes();

    Sentence sentence1 = new Sentence(jcas, 1, 2);
    sentence1.addToIndexes();

    // index2 is a set index, so even when adding a sentence twice, only one remains in the index
    Sentence sentence2 = new Sentence(jcas, 3, 4);
    sentence2.addToIndexes();
    sentence2.addToIndexes();
View Full Code Here

Examples of org.apache.uima.fit.type.Token.addToIndexes()

    // analysis engine.
    AnalysisEngine desc = createEngine(IndexTestComponent.class);
    JCas jcas = desc.newJCas();

    Token token1 = new Token(jcas, 1, 2);
    token1.addToIndexes();

    // index1 is a sorted index, so when adding a token twice, both remain in the index
    Token token2 = new Token(jcas, 3, 4);
    token2.addToIndexes();
    token2.addToIndexes();
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.