Package com.gengoai.hermes.annotator
Class LexiconAnnotator
- java.lang.Object
-
- com.gengoai.hermes.annotator.Annotator
-
- com.gengoai.hermes.annotator.SentenceLevelAnnotator
-
- com.gengoai.hermes.annotator.LexiconAnnotator
-
- All Implemented Interfaces:
Serializable
public class LexiconAnnotator extends SentenceLevelAnnotator implements Serializable
Annotator that provides annotations based on a lexicon.- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LexiconAnnotator(@NonNull AnnotationType type, @NonNull Lexicon lexicon)
Instantiates a new LexiconAnnotator.LexiconAnnotator(@NonNull AnnotationType type, @NonNull String lexiconName)
Instantiates a new LexiconAnnotator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
annotate(@NonNull Annotation sentence)
Annotates a single sentence.String
getProvider(Language language)
Gets the provider information for this annotator..Set<AnnotatableType>
satisfies()
The set of annotation types that this annotator satisfies by this annotator-
Methods inherited from class com.gengoai.hermes.annotator.SentenceLevelAnnotator
annotateImpl, furtherRequires, requires
-
-
-
-
Constructor Detail
-
LexiconAnnotator
public LexiconAnnotator(@NonNull @NonNull AnnotationType type, @NonNull @NonNull String lexiconName)
Instantiates a new LexiconAnnotator.- Parameters:
type
- the type of annotation to create.lexiconName
- the name of the lexicon to perform annotation based on
-
LexiconAnnotator
public LexiconAnnotator(@NonNull @NonNull AnnotationType type, @NonNull @NonNull Lexicon lexicon)
Instantiates a new LexiconAnnotator.- Parameters:
type
- the type of annotation to create.lexicon
- the lexicon to perform annotation based on
-
-
Method Detail
-
annotate
protected void annotate(@NonNull @NonNull Annotation sentence)
Description copied from class:SentenceLevelAnnotator
Annotates a single sentence.- Specified by:
annotate
in classSentenceLevelAnnotator
- Parameters:
sentence
- The sentence to annotate
-
getProvider
public String getProvider(Language language)
Description copied from class:Annotator
Gets the provider information for this annotator.. The provider information should relate to a version number, model used, or something else to identify the settings of the annotator.- Overrides:
getProvider
in classAnnotator
- Returns:
- the provider
-
satisfies
public Set<AnnotatableType> satisfies()
Description copied from class:Annotator
The set of annotation types that this annotator satisfies by this annotator
-
-