MATCH_ALL, MATCH_COMPLETE, MATCH_FIRST, MATCH_GROUP_REGEX_BEGIN, MATCH_GROUP_REGEX_END, MATCH_GROUP_REGEX_PATTERN, MATCH_GROUP_START
Constructor and Description |
---|
Rule_impl(String regex,
int matchStrategy,
String matchType,
String id,
float confidence,
String featurePath,
RegexVariables variables)
Constructor to create a new Rule object.
|
Modifier and Type | Method and Description |
---|---|
void |
addException(RuleException aException)
Adds the given exception to this rule
|
void |
addFilterFeature(FilterFeature aFeature)
Adds the given feature to the match type filter features
|
void |
addUpdateFeature(Feature aFeature)
Adds the given feature to the match type annotation update features
|
float |
getConfidence()
Get the rule confidence
|
RuleException[] |
getExceptions()
Returns the exceptions for this rule
|
String |
getId()
Get the rule id
|
int |
getMatchGroupNumber(String matchGroupName)
Returns the match group number for the given match group name or -1 if
the match group name is not available.
|
int |
getMatchStrategy()
Get the match strategy of this rule;
|
org.apache.uima.cas.Type |
getMatchType()
Get the match type of this rule.
|
FeaturePath |
getMatchTypeFeaturePath()
Returns the match type featurePath object.
|
FilterFeature[] |
getMatchTypeFilterFeatures()
Returns the match type filter features
|
Feature[] |
getMatchTypeUpdateFeatures()
Returns the match type annotation update features
|
Pattern |
getRegexPattern()
Get the regular expression of this rule.
|
void |
initialize() |
boolean |
isFeaturePathMatch()
Returns true if a featurePath for this rule was specified.
|
String |
toString() |
void |
typeInit(org.apache.uima.cas.TypeSystem ts) |
public Rule_impl(String regex, int matchStrategy, String matchType, String id, float confidence, String featurePath, RegexVariables variables)
regex
- regex pattern as StringmatchStrategy
- matching strategymatchType
- match type as Stringid
- rule id (can also be null)confidence
- confidence valuefeaturePath
- featurePath (can also be null)public void addFilterFeature(FilterFeature aFeature)
Rule
addFilterFeature
in interface Rule
aFeature
- The feature to be added.public FilterFeature[] getMatchTypeFilterFeatures()
Rule
getMatchTypeFilterFeatures
in interface Rule
public int getMatchStrategy()
Rule
getMatchStrategy
in interface Rule
public org.apache.uima.cas.Type getMatchType()
Rule
getMatchType
in interface Rule
public Pattern getRegexPattern()
Rule
getRegexPattern
in interface Rule
public float getConfidence()
Rule
getConfidence
in interface Rule
public void addUpdateFeature(Feature aFeature)
Rule
addUpdateFeature
in interface Rule
aFeature
- The feature to be added.public Feature[] getMatchTypeUpdateFeatures()
Rule
getMatchTypeUpdateFeatures
in interface Rule
public void addException(RuleException aException)
Rule
addException
in interface Rule
aException
- The exception to be added.public RuleException[] getExceptions()
Rule
getExceptions
in interface Rule
public FeaturePath getMatchTypeFeaturePath()
Rule
getMatchTypeFeaturePath
in interface Rule
public boolean isFeaturePathMatch()
Rule
isFeaturePathMatch
in interface Rule
public void typeInit(org.apache.uima.cas.TypeSystem ts) throws org.apache.uima.resource.ResourceInitializationException
ts
- org.apache.uima.resource.ResourceInitializationException
public void initialize() throws RegexAnnotatorConfigException
RegexAnnotatorConfigException
public int getMatchGroupNumber(String matchGroupName)
Rule
getMatchGroupNumber
in interface Rule
matchGroupName
- match group nameCopyright © 2006–2023 The Apache Software Foundation. All rights reserved.