public static class SubstringLabelerRules.SubstringLabelerMatchRule extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
MATCH_PART_SEPARATOR
Separator for parts of the match specification
|
| Constructor and Description |
|---|
SubstringLabelerRules.SubstringLabelerMatchRule()
Constructor
|
SubstringLabelerRules.SubstringLabelerMatchRule(String setup)
Constructor
|
SubstringLabelerRules.SubstringLabelerMatchRule(String match,
boolean regex,
boolean ignoreCase,
String selectedAtts)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
String |
apply(Instance inst)
Apply this rule to the supplied instance
|
String |
getAttsToApplyTo()
Get the attributes to apply the rule to
|
boolean |
getIgnoreCase()
Get whether to ignore case when matching
|
String |
getLabel()
Get the label to assign if this rule matches, or empty string if binary
flag attribute is being created.
|
String |
getMatch()
Get the string/regex to use for matching
|
boolean |
getRegex()
Get whether this is a regular expression match or not
|
void |
init(Environment env,
Instances structure)
Initialize this match rule by substituting any environment variables in
the attributes, match and label strings.
|
void |
setAttsToApplyTo(String a)
Set the attributes to apply the rule to
|
void |
setIgnoreCase(boolean ignore)
Set whether to ignore case when matching
|
void |
setLabel(String label)
Set the label to assign if this rule matches, or empty string if binary
flag attribute is being created.
|
void |
setMatch(String match)
Set the string/regex to use for matching
|
void |
setRegex(boolean regex)
Set whether this is a regular expression match or not
|
String |
toString()
Return a textual description of this match rule
|
public static final String MATCH_PART_SEPARATOR
public SubstringLabelerRules.SubstringLabelerMatchRule()
public SubstringLabelerRules.SubstringLabelerMatchRule(String setup)
setup - an internally encoded representation of all the match
information for this rulepublic SubstringLabelerRules.SubstringLabelerMatchRule(String match, boolean regex, boolean ignoreCase, String selectedAtts)
match - the match stringregex - true if this is a regular expression matchignoreCase - true if case is to be ignoredselectedAtts - the attributes to apply the rule topublic void setMatch(String match)
match - the match stringpublic String getMatch()
public void setLabel(String label)
label - the label string or empty stringpublic String getLabel()
public void setRegex(boolean regex)
regex - true if this is a regular expression matchpublic boolean getRegex()
public void setIgnoreCase(boolean ignore)
ignore - true if case is to be ignoredpublic boolean getIgnoreCase()
public void setAttsToApplyTo(String a)
a - the attributes to apply the rule to.public String getAttsToApplyTo()
public void init(Environment env, Instances structure)
env - the environment variablesstructure - the structure of the incoming instancespublic String apply(Instance inst)
inst - the instance to apply toCopyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.