org.apache.uima.annotator.regex.impl
Class Rule_impl

java.lang.Object
  extended by org.apache.uima.annotator.regex.impl.Rule_impl
All Implemented Interfaces:
Rule

public class Rule_impl
extends java.lang.Object
implements Rule

Implementation of the Rule interface.


Field Summary
 
Fields inherited from interface org.apache.uima.annotator.regex.Rule
MATCH_ALL, MATCH_COMPLETE, MATCH_FIRST, MATCH_GROUP_REGEX_BEGIN, MATCH_GROUP_REGEX_END, MATCH_GROUP_REGEX_PATTERN, MATCH_GROUP_START
 
Constructor Summary
Rule_impl(java.lang.String regex, int matchStrategy, java.lang.String matchType, java.lang.String id, float confidence, java.lang.String featurePath, RegexVariables variables)
          Constructor to create a new Rule object.
 
Method Summary
 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
 java.lang.String getId()
          Get the rule id
 int getMatchGroupNumber(java.lang.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
 java.util.regex.Pattern getRegexPattern()
          Get the regular expression of this rule.
 void initialize()
           
 boolean isFeaturePathMatch()
          Returns true if a featurePath for this rule was specified.
 java.lang.String toString()
           
 void typeInit(org.apache.uima.cas.TypeSystem ts)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rule_impl

public Rule_impl(java.lang.String regex,
                 int matchStrategy,
                 java.lang.String matchType,
                 java.lang.String id,
                 float confidence,
                 java.lang.String featurePath,
                 RegexVariables variables)
Constructor to create a new Rule object.

Parameters:
regex - regex pattern as String
matchStrategy - matching strategy
matchType - match type as String
id - rule id (can also be null)
confidence - confidence value
featurePath - featurePath (can also be null)
Method Detail

addFilterFeature

public void addFilterFeature(FilterFeature aFeature)
Description copied from interface: Rule
Adds the given feature to the match type filter features

Specified by:
addFilterFeature in interface Rule
Parameters:
aFeature - The feature to be added.

getMatchTypeFilterFeatures

public FilterFeature[] getMatchTypeFilterFeatures()
Description copied from interface: Rule
Returns the match type filter features

Specified by:
getMatchTypeFilterFeatures in interface Rule
Returns:
returns the match type feature filters

getMatchStrategy

public int getMatchStrategy()
Description copied from interface: Rule
Get the match strategy of this rule;

Specified by:
getMatchStrategy in interface Rule
Returns:
returns the match strategy of this rule.

getMatchType

public org.apache.uima.cas.Type getMatchType()
Description copied from interface: Rule
Get the match type of this rule.

Specified by:
getMatchType in interface Rule
Returns:
returns the match type of this rule.

getRegexPattern

public java.util.regex.Pattern getRegexPattern()
Description copied from interface: Rule
Get the regular expression of this rule.

Specified by:
getRegexPattern in interface Rule
Returns:
returns the regular expression of this rule.

getConfidence

public float getConfidence()
Description copied from interface: Rule
Get the rule confidence

Specified by:
getConfidence in interface Rule
Returns:
returns the rule confidence

getId

public java.lang.String getId()
Description copied from interface: Rule
Get the rule id

Specified by:
getId in interface Rule
Returns:
returns the rule id

addUpdateFeature

public void addUpdateFeature(Feature aFeature)
Description copied from interface: Rule
Adds the given feature to the match type annotation update features

Specified by:
addUpdateFeature in interface Rule
Parameters:
aFeature - The feature to be added.

getMatchTypeUpdateFeatures

public Feature[] getMatchTypeUpdateFeatures()
Description copied from interface: Rule
Returns the match type annotation update features

Specified by:
getMatchTypeUpdateFeatures in interface Rule
Returns:
returns the match type annotation update features

addException

public void addException(RuleException aException)
Description copied from interface: Rule
Adds the given exception to this rule

Specified by:
addException in interface Rule
Parameters:
aException - The exception to be added.

getExceptions

public RuleException[] getExceptions()
Description copied from interface: Rule
Returns the exceptions for this rule

Specified by:
getExceptions in interface Rule
Returns:
returns the exceptions for this rule

getMatchTypeFeaturePath

public FeaturePath getMatchTypeFeaturePath()
Description copied from interface: Rule
Returns the match type featurePath object.

Specified by:
getMatchTypeFeaturePath in interface Rule
Returns:
returns the match type featurePath object

isFeaturePathMatch

public boolean isFeaturePathMatch()
Description copied from interface: Rule
Returns true if a featurePath for this rule was specified.

Specified by:
isFeaturePathMatch in interface Rule
Returns:
true if a featurePath was specified for this rule

typeInit

public void typeInit(org.apache.uima.cas.TypeSystem ts)
              throws org.apache.uima.resource.ResourceInitializationException
Parameters:
ts -
Throws:
org.apache.uima.resource.ResourceInitializationException

initialize

public void initialize()
                throws RegexAnnotatorConfigException
Throws:
RegexAnnotatorConfigException

getMatchGroupNumber

public int getMatchGroupNumber(java.lang.String matchGroupName)
Description copied from interface: Rule
Returns the match group number for the given match group name or -1 if the match group name is not available.

Specified by:
getMatchGroupNumber in interface Rule
Parameters:
matchGroupName - match group name
Returns:
returns the match group number for the given name or -1 if the match group does not exist.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011. All Rights Reserved.