Class Layers
java.lang.Object
opennlp.tools.document.Layers
The standard
layer keys for the results the toolkit produces itself.
Every key defined here carries the opennlp: id prefix, which
key(String, Class) and documentKey(String, Class) apply. Other
producers define their keys in their own packages under their own prefix.
- Since:
- 3.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionNamed entities; each annotation covers one mention and carries the entity type as its value.Part-of-speech tags; one annotation per token, aligned withTOKENSby position, carrying the tag.Sentence boundaries; each annotation covers one sentence and carries its text.Token boundaries; each annotation covers one token and carries its text. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> LayerKey<T> documentKey(String name, Class<T> type) Creates adocument-scopedkey in the toolkit'sopennlp:namespace, for a whole-document value the toolkit itself produces.static <T> LayerKey<T> Creates apositionalkey in the toolkit'sopennlp:namespace, for a layer the toolkit itself produces.
-
Field Details
-
SENTENCES
-
TOKENS
-
POS_TAGS
-
ENTITIES
-
-
Method Details
-
key
Creates apositionalkey in the toolkit'sopennlp:namespace, for a layer the toolkit itself produces.- Type Parameters:
T- The type of the annotation values.- Parameters:
name- The layer name without a namespace, for exampletokens. Must not benull, blank, or contain':'.type- The class of the annotation values stored under the key. Must not benull.- Returns:
- A key whose id is the name under the
opennlp:prefix. Nevernull. - Throws:
IllegalArgumentException- Thrown ifnameisnull, blank, or contains':', ortypeisnull.
-
documentKey
Creates adocument-scopedkey in the toolkit'sopennlp:namespace, for a whole-document value the toolkit itself produces.- Type Parameters:
T- The type of the annotation values.- Parameters:
name- The layer name without a namespace, for examplelanguage. Must not benull, blank, or contain':'.type- The class of the annotation values stored under the key. Must not benull.- Returns:
- A document-scoped key whose id is the name under the
opennlp:prefix. Nevernull. - Throws:
IllegalArgumentException- Thrown ifnameisnull, blank, or contains':', ortypeisnull.
-