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)
RuleaddFilterFeature in interface RuleaFeature - The feature to be added.public FilterFeature[] getMatchTypeFilterFeatures()
RulegetMatchTypeFilterFeatures in interface Rulepublic int getMatchStrategy()
RulegetMatchStrategy in interface Rulepublic org.apache.uima.cas.Type getMatchType()
RulegetMatchType in interface Rulepublic Pattern getRegexPattern()
RulegetRegexPattern in interface Rulepublic float getConfidence()
RulegetConfidence in interface Rulepublic void addUpdateFeature(Feature aFeature)
RuleaddUpdateFeature in interface RuleaFeature - The feature to be added.public Feature[] getMatchTypeUpdateFeatures()
RulegetMatchTypeUpdateFeatures in interface Rulepublic void addException(RuleException aException)
RuleaddException in interface RuleaException - The exception to be added.public RuleException[] getExceptions()
RulegetExceptions in interface Rulepublic FeaturePath getMatchTypeFeaturePath()
RulegetMatchTypeFeaturePath in interface Rulepublic boolean isFeaturePathMatch()
RuleisFeaturePathMatch in interface Rulepublic void typeInit(org.apache.uima.cas.TypeSystem ts)
throws org.apache.uima.resource.ResourceInitializationException
ts - org.apache.uima.resource.ResourceInitializationExceptionpublic void initialize()
throws RegexAnnotatorConfigException
RegexAnnotatorConfigExceptionpublic int getMatchGroupNumber(String matchGroupName)
RulegetMatchGroupNumber in interface RulematchGroupName - match group nameCopyright © 2006–2025 The Apache Software Foundation. All rights reserved.