Examples of JFSIndexRepository


Examples of org.apache.uima.jcas.JFSIndexRepository

    * {@inheritDoc}
    */
   @Override
   public Iterator<Annotation> getLookupWindowIterator( final JCas jcas ) throws AnnotatorInitializationException {
      try {
         final JFSIndexRepository indexes = jcas.getJFSIndexRepository();
         final String objClassName = iv_props.getProperty( WINDOW_ANNOT_PRP_KEY );
         int windowType;
         try {
            windowType = JCasUtil.getType( objClassName );
         } catch ( IllegalArgumentException iaE ) {
            // thrown by JCasUtil.getType()
            throw new AnnotatorInitializationException( iaE );
         }
         return indexes.getAnnotationIndex( windowType ).iterator();
      } catch ( Exception e ) {
         // TODO specify exceptions, get rid of the catch for "Exception"
         throw new AnnotatorInitializationException( e );
      }
   }
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

      if ( iv_annotTypeArr == null ) {
         return Collections.emptyMap();
      }
      final List<LookupAnnotation> list = new ArrayList<LookupAnnotation>();
      // algorithm depends on a window for permutations
      final JFSIndexRepository indexes = jcas.getJFSIndexRepository();
      for ( int annotationType : iv_annotTypeArr ) {
         final Iterator<Annotation> itr = indexes.getAnnotationIndex( annotationType ).iterator();
         list.addAll( constrainToWindow( windowBegin, windowEnd, itr ) );
      }
      final Map<String, List<LookupAnnotation>> m = new HashMap<String, List<LookupAnnotation>>( 1 );
      m.put( FirstTokenPermutationImpl.CTX_KEY_WINDOW_ANNOTATIONS, list );
      return m;
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

    String text = jcas.getDocumentText();

    try {
      if (useSegments) {
        JFSIndexRepository indexes = jcas.getJFSIndexRepository();
        Iterator<?> segmentItr = indexes.getAnnotationIndex(Segment.type)
            .iterator();
        while (segmentItr.hasNext()) {
          Segment segmentAnnotation = (Segment) segmentItr.next();
          String segmentID = segmentAnnotation.getId();
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

   * A utility method that annotates a given range.
   */
  protected void annotateRange(JCas jcas, String text, int rangeBegin,
      int rangeEnd)
      throws AnalysisEngineProcessException {
    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    Iterator<?> wordItr = indexes.getAnnotationIndex(WordToken.type)
        .iterator();
    while (wordItr.hasNext()) {
      WordToken wordAnnotation = (WordToken) wordItr.next();
      if (wordAnnotation.getBegin() >= rangeBegin
          && wordAnnotation.getEnd() <= rangeEnd) {
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

  }  
 
    }

    private FSIterator<Annotation> getAllAnnotations(JCas jcas, int type) {
  JFSIndexRepository indexes = jcas.getJFSIndexRepository();
  FSIterator<Annotation> annotationsIter = indexes.getAnnotationIndex(type).iterator();
        //  while (segmentItr.hasNext()) {
        //  }
  return annotationsIter;
    }
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

   * @return int[0] is begin offset and int[1] is end offset
   * @throws Exception
   */
  private int[] getAdjustedWindowSpan(JCas jcas,  int begin, int end, boolean highestRange) throws Exception {
    int[] spanStrength = {-1, -1}, spanFrequency = {-1, -1}, spanDose = {-1, -1};
    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    int[] senSpan = {begin, end };

    // Up to 10 of each type of signature item and drug mentions are allowed.  If more than that are available the
    // ArrayIndexOutOfBoundsException is thrown/caught and the sentence is skipped

View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

   * @param begin
   * @param end
   * @return
   */
  private int findInPattern(JCas jcas, int begin, int end, int elementType, int[][] location) {
    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    Iterator neItr = indexes.getAnnotationIndex(elementType).iterator();//FSUtil.getAnnotationsInSpanIterator(jcas, elementType, begin, end);
    int [] lastLocation =  {-1,-1};
    int counter = 0;
    if (elementType == StrengthUnitAnnotation.type) {
      while (neItr.hasNext()) {
        StrengthUnitAnnotation nea = (StrengthUnitAnnotation) neItr.next();
View Full Code Here

Examples of org.apache.uima.jcas.JFSIndexRepository

   * @param begin
   * @param end
   * @return
   */
  private int lastInPattern(JCas jcas, int begin, int end, int elementType, int[][] location) {
    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    Iterator neItr = indexes.getAnnotationIndex(elementType).iterator();
    int [] lastLocation =  {-1,-1};
    int counter = 0;
    if (elementType == StrengthAnnotation.type) {
      int holdBeginElement = 0, holdEndElement = 0;
      while (neItr.hasNext()) {
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
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.