Class CoreAnnotations.IndexAnnotation

  • All Implemented Interfaces:
    CoreAnnotation<Integer>, TypesafeMap.Key<Integer>
    Enclosing class:
    CoreAnnotations

    public static class CoreAnnotations.IndexAnnotation
    extends Object
    implements CoreAnnotation<Integer>
    This indexes a token number inside a sentence. Standardly, tokens are indexed within a sentence starting at 1 (not 0: we follow common parlance whereby we speak of the first word of a sentence). This is generally an individual word or feature index - it is local, and may not be uniquely identifying without other identifiers such as sentence and doc. However, if these are the same, the index annotation should be a unique identifier for differentiating objects.
    • Constructor Detail

      • IndexAnnotation

        public IndexAnnotation()
    • Method Detail

      • 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>