Class AnnotationLookup


  • public class AnnotationLookup
    extends Object
    Provides a mapping between CoreAnnotation keys, which are classes, and a text String that names them, which is needed for things like text serializations and the Semgrex query language.
    Author:
    Anna Rafferty
    • Method Detail

      • toCoreKey

        public static Class<? extends CoreAnnotation<?>> toCoreKey​(String stringKey)
        Returns a CoreAnnotation class key for the given string key if one exists; null otherwise.
        Parameters:
        stringKey - String form of the key
        Returns:
        A CoreLabel/CoreAnnotation key, or null if nothing matches
      • getValueType

        public static Class<?> getValueType​(Class<? extends CoreAnnotation<?>> key)
        Returns the runtime value type associated with the given key. Caches results in a private Map.
        Parameters:
        key - The annotation key (non-null)
        Returns:
        The type of the value of that key (non-null)