Package com.gengoai.hermes.annotator
Class RegexAnnotator
- java.lang.Object
-
- com.gengoai.hermes.annotator.Annotator
-
- com.gengoai.hermes.annotator.RegexAnnotator
-
- All Implemented Interfaces:
Serializable
public class RegexAnnotator extends Annotator
Annotator that constructs annotations based on regular expression matches. Matches are performed on word boundaries.- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RegexAnnotator(@NonNull String regex, @NonNull AnnotationType providedType)
Instantiates a new RegexAnnotator.RegexAnnotator(@NonNull String regex, @NonNull String providedType)
Instantiates a new RegexAnnotator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
annotateImpl(@NonNull Document document)
Annotates a document with one or more AnnotatableType defined insatisfies()
.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
-
-
-
Constructor Detail
-
RegexAnnotator
public RegexAnnotator(@NonNull @NonNull String regex, @NonNull @NonNull AnnotationType providedType)
Instantiates a new RegexAnnotator.- Parameters:
regex
- the regular expression to matchprovidedType
- the annotation type to use for constructed annotations.
-
-
Method Detail
-
annotateImpl
protected void annotateImpl(@NonNull @NonNull Document document)
Description copied from class:Annotator
Annotates a document with one or more AnnotatableType defined insatisfies()
.- Specified by:
annotateImpl
in classAnnotator
- Parameters:
document
- The document 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
-
-