Class JCoReAnnotationIndexMerger


  • public class JCoReAnnotationIndexMerger
    extends java.lang.Object
    This class takes multiple UIMA indices, e.g. Token, EntityMention and Part of Speech, and merges them into a single iterator that then outputs the respective annotations as a sequence. The most useful functionality is the capability of the annotation merger to sort the annotations efficiently on the fly by start offsets. Thus, when given a range of UIMA annotation indices, the annotation merger is able to intertwine the annotations in correct reading order.
    • Constructor Detail

      • JCoReAnnotationIndexMerger

        public JCoReAnnotationIndexMerger​(java.util.Set<?> annotationTypes,
                                          boolean sort,
                                          org.apache.uima.cas.text.AnnotationFS coveringAnnotation,
                                          org.apache.uima.jcas.JCas aJCas)
                                   throws java.lang.ClassNotFoundException
        Constructs a new annotation index merger.
        Parameters:
        annotationTypes - The CAS integer constant of the types, the qualified Java class names of the types or the Type object of the types to merge the annotation indexes.
        sort - If set to true, the annotations will be returned sorted ascendingly by begin offset.
        coveringAnnotation - May be null. If given, the returned annotations will be restricted to those covered by the given annotation.
        aJCas - The CAS containing the annotations.
        Throws:
        java.lang.ClassNotFoundException
    • Method Detail

      • firstToken

        public boolean firstToken()
      • getAnnotation

        public org.apache.uima.jcas.cas.TOP getAnnotation()
      • getCurrentBegin

        public int getCurrentBegin()
      • setCurrentBegin

        public void setCurrentBegin​(int currentBegin)
      • getCurrentEnd

        public int getCurrentEnd()
      • setCurrentEnd

        public void setCurrentEnd​(int currentEnd)
      • hasBeginOffsetChanged

        public boolean hasBeginOffsetChanged()
      • incrementAnnotation

        public boolean incrementAnnotation()
      • moveIterator

        protected boolean moveIterator​(boolean initialize)
      • setCurrentAnnotation

        protected void setCurrentAnnotation()