edu.stanford.nlp.pipeline
Class TokensRegexAnnotator
java.lang.Object
edu.stanford.nlp.pipeline.TokensRegexAnnotator
- All Implemented Interfaces:
- Annotator
public class TokensRegexAnnotator
- extends java.lang.Object
- implements Annotator
Uses TokensRegex patterns to annotate tokens.
Configuration:
Other options (can be set in rules file using options.xxx = ...)
setTokenOffsets - whether to explicit set the token offsets of individual tokens (needed to token sequence matches to work)
extractWithTokens - whether to return unmatched tokens as well
flatten - whether to flatten matched expressions into individual tokens
matchedExpressionsAnnotationKey - Annotation key where matched expressions are stored as a list
Multiple TokensRegexAnnotator can be configured using the same properties file by specifying
difference prefix for the TokensRegexAnnotator
- Author:
- Angel Chang
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TokensRegexAnnotator
public TokensRegexAnnotator(java.lang.String... files)
TokensRegexAnnotator
public TokensRegexAnnotator(java.lang.String name,
java.util.Properties props)
TokensRegexAnnotator
public TokensRegexAnnotator(java.util.Properties props)
addTokenOffsets
public void addTokenOffsets(CoreMap annotation)
annotate
public void annotate(Annotation annotation)
- Specified by:
annotate in interface Annotator
Stanford NLP Group