edu.stanford.nlp.ling
Class CoreAnnotations.BeginIndexAnnotation
java.lang.Object
edu.stanford.nlp.ling.CoreAnnotations.BeginIndexAnnotation
- All Implemented Interfaces:
- CoreAnnotation<Integer>, TypesafeMap.Key<CoreMap,Integer>
- Enclosing class:
- CoreAnnotations
public static class CoreAnnotations.BeginIndexAnnotation
- extends Object
- implements CoreAnnotation<Integer>
This indexes the beginning of a span of words, e.g., a constituent in a
tree. See Tree.indexSpans(int)
.
This annotation counts tokens.
It standardly indexes from 1 (like IndexAnnotation). The reasons for
this are: (i) Talking about the first word of a sentence is kind of
natural, and (ii) We use index 0 to refer to an imaginary root in
dependency output.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CoreAnnotations.BeginIndexAnnotation
public CoreAnnotations.BeginIndexAnnotation()
getType
public Class<Integer> getType()
- Description copied from interface:
CoreAnnotation
- Returns the type associated with this annotation. This method must
return the same class type as its value type parameter. It feels like
one should be able to get away without this method, but because Java
erases the generic type signature, that info disappears at runtime.
- Specified by:
getType
in interface CoreAnnotation<Integer>
Stanford NLP Group