Package edu.stanford.nlp.ling
Class AnnotationLookup
- java.lang.Object
-
- edu.stanford.nlp.ling.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 Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Class<?>getValueType(Class<? extends CoreAnnotation<?>> key)Returns the runtime value type associated with the given key.static Class<? extends CoreAnnotation<?>>toCoreKey(String stringKey)Returns a CoreAnnotation class key for the given string key if one exists; null otherwise.
-
-
-
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
nullif 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)
-
-