Package de.julielab.jcore.utility
Class JCoReAnnotationIndexMerger
- java.lang.Object
-
- de.julielab.jcore.utility.JCoReAnnotationIndexMerger
-
public class JCoReAnnotationIndexMerger extends 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 Summary
Constructors Constructor Description JCoReAnnotationIndexMerger(Set<?> annotationTypes, boolean sort, org.apache.uima.cas.text.AnnotationFS coveringAnnotation, org.apache.uima.jcas.JCas aJCas)Constructs a new annotation index merger.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanfirstToken()org.apache.uima.jcas.cas.TOPgetAnnotation()intgetCurrentBegin()intgetCurrentEnd()booleanhasBeginOffsetChanged()booleanincrementAnnotation()protected booleanmoveIterator(boolean initialize)protected voidsetCurrentAnnotation()voidsetCurrentBegin(int currentBegin)voidsetCurrentEnd(int currentEnd)
-
-
-
Constructor Detail
-
JCoReAnnotationIndexMerger
public JCoReAnnotationIndexMerger(Set<?> annotationTypes, boolean sort, org.apache.uima.cas.text.AnnotationFS coveringAnnotation, org.apache.uima.jcas.JCas aJCas) throws 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 theTypeobject 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:
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()
-
-