public class AnnotationIdCollection
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
AnnotationIdCollection.ArgComparator |
Modifier and Type | Field and Description |
---|---|
private java.util.Map<Annotation,java.lang.Integer> |
_entityIdMap |
private java.util.Map<java.lang.Integer,Annotation> |
_idAnnotationMap |
static int |
NO_ENTITY_ID |
Constructor and Description |
---|
AnnotationIdCollection(java.util.ArrayList<BinaryTextRelation> temporalRelation) |
Modifier and Type | Method and Description |
---|---|
Annotation |
getAnnotation(Annotation entity) |
Annotation |
getAnnotation(int entityId) |
int |
getAnnotationId(Annotation entity) |
java.util.Set<java.lang.Integer> |
getAnnotationIds() |
private int |
getIdByAnnotationEqual(Annotation entity) |
private int |
getIdByTextSpan(int begin,
int end) |
public static final int NO_ENTITY_ID
private final java.util.Map<Annotation,java.lang.Integer> _entityIdMap
private final java.util.Map<java.lang.Integer,Annotation> _idAnnotationMap
public AnnotationIdCollection(java.util.ArrayList<BinaryTextRelation> temporalRelation)
public java.util.Set<java.lang.Integer> getAnnotationIds()
public int getAnnotationId(Annotation entity)
entity
- some entity, be it unique on its own or part of a coreference chainprivate int getIdByAnnotationEqual(Annotation entity)
private int getIdByTextSpan(int begin, int end)
public Annotation getAnnotation(int entityId)
entityId
- some idpublic Annotation getAnnotation(Annotation entity)