public class Env extends Object
EnvLookup
to perform actual lookup (it will provide reasonable defaults)
Some of the types of variables to bind are:
SequencePattern
(compiled pattern)PatternExpr
(sequence pattern expression - precompiled)NodePattern
(pattern for matching one element)Class
(binding of CoreMap attribute to java Class)Modifier and Type | Class and Description |
---|---|
static interface |
Env.Binder
Interface for performing custom binding of values to the environment
|
Modifier and Type | Field and Description |
---|---|
Class |
defaultNestedResultsAnnotationKey
Annotation key to use during composite phase for storing matched sequences and to match against.
|
List<Class> |
defaultResultAnnotationKey
List of keys indicating what fields should be annotated for the aggregated coremap.
|
Map<String,Object> |
defaults
Default parameters (used when reading in rules for
SequenceMatchRules . |
int |
defaultStringMatchFlags
Default flags to use for string literal match
|
int |
defaultStringPatternFlags
Default flags to use for string regular expressions match
|
Class |
defaultTextAnnotationKey
Annotation key to use to getting text (default is CoreAnnotations.TextAnnotation.class)
|
Map<Class,CoreMapAttributeAggregator> |
defaultTokensAggregators
How should the tokens be aggregated when collapsing a sequence of tokens into one CoreMap
|
Class |
defaultTokensAnnotationKey
Annotation key to use to getting tokens (default is CoreAnnotations.TokensAnnotation.class)
|
List<Class> |
defaultTokensResultAnnotationKey
List of keys indicating the per-token annotations (default is null).
|
Class |
sequenceMatchResultExtractor |
Class |
stringMatchResultExtractor |
Constructor and Description |
---|
Env(SequencePattern.Parser p) |
public Map<String,Object> defaults
SequenceMatchRules
.public int defaultStringPatternFlags
Pattern.compile(String,int)
public int defaultStringMatchFlags
NodePattern.CASE_INSENSITIVE
public Class sequenceMatchResultExtractor
public Class stringMatchResultExtractor
public Class defaultTokensAnnotationKey
public Class defaultTextAnnotationKey
public List<Class> defaultTokensResultAnnotationKey
defaultResultsAnnotationExtractor
.
If null, then individual tokens that are matched are not annotated.public List<Class> defaultResultAnnotationKey
defaultResultsAnnotationExtractor
.
If null, then the aggregated coremap is not annotated.public Class defaultNestedResultsAnnotationKey
public Map<Class,CoreMapAttributeAggregator> defaultTokensAggregators
public Env(SequencePattern.Parser p)
public void initDefaultBindings()
public Map<Class,CoreMapAttributeAggregator> getDefaultTokensAggregators()
public void setDefaultTokensAggregators(Map<Class,CoreMapAttributeAggregator> defaultTokensAggregators)
public Class getDefaultTextAnnotationKey()
public void setDefaultTextAnnotationKey(Class defaultTextAnnotationKey)
public Class getDefaultTokensAnnotationKey()
public void setDefaultTokensAnnotationKey(Class defaultTokensAnnotationKey)
public void setDefaultTokensResultAnnotationKey(Class... defaultTokensResultAnnotationKey)
public void setDefaultTokensResultAnnotationKey(List<Class> defaultTokensResultAnnotationKey)
public void setDefaultResultAnnotationKey(Class... defaultResultAnnotationKey)
public void setDefaultResultAnnotationKey(List<Class> defaultResultAnnotationKey)
public Class getDefaultNestedResultsAnnotationKey()
public void setDefaultNestedResultsAnnotationKey(Class defaultNestedResultsAnnotationKey)
public java.util.function.Function<MatchedExpression,?> getDefaultResultsAnnotationExtractor()
public void setDefaultResultsAnnotationExtractor(java.util.function.Function<MatchedExpression,?> defaultResultsAnnotationExtractor)
public Class getSequenceMatchResultExtractor()
public void setSequenceMatchResultExtractor(Class sequenceMatchResultExtractor)
public Class getStringMatchResultExtractor()
public void setStringMatchResultExtractor(Class stringMatchResultExtractor)
public void clearVariables()
public int getDefaultStringPatternFlags()
public void setDefaultStringPatternFlags(int defaultStringPatternFlags)
public int getDefaultStringMatchFlags()
public void setDefaultStringMatchFlags(int defaultStringMatchFlags)
public void bind(String name, SequencePattern pattern)
public void unbind(String name)
public NodePattern getNodePattern(String name)
public SequencePattern.PatternExpr getSequencePatternExpr(String name, boolean copy)