Java Reference
In-Depth Information
After annotate method executed
Class:
edu.stanford.nlp.ling.CoreAnnotations.TextAnnotation
Class:
edu.stanford.nlp.ling.CoreAnnotations.TokensAnnotation
Class:
edu.stanford.nlp.ling.CoreAnnotations.SentencesAnnotation
Class:
edu.stanford.nlp.dcoref.CorefCoreAnnotations.CorefChainAnnotation
The
CoreLabel
class implements the
CoreMap
interface. It represents a single word
with annotation information attached to it. The information attached depends on the prop-
erties set when the pipeline is created. However, there will always be positional informa-
tion available such as its beginning and ending position or the whitespace before and after
the entity.
The
get
method for either
CoreMap
or
CoreLabel
returns information specific to its
argument. The
get
method is overloaded and returns a value dependent on the type of its
argument. For example, here is the declaration of the
SentencesAnnotation
class. It
implements
CoreAnnotation<List<CoreMap>>
:
public static class CoreAnnotations.SentencesAnnotation
extends Object
implements CoreAnnotation<List<CoreMap>>
When used in the following statement, the
SentencesAnnotation
class returns a
List<CoreMap>
instance:
List<CoreMap> sentences =
annotation.get(SentencesAnnotation.class);
In a similar manner, the
TokensAnnotation
class implements
CoreAnnota-
tion<List<CoreLabel>>
as shown here:
public static class CoreAnnotations.TokensAnnotation
extends Object
implements CoreAnnotation<List<CoreLabel>>