Package weka.gui.beans
Class SubstringReplacerRules
java.lang.Object
weka.gui.beans.SubstringReplacerRules
- All Implemented Interfaces:
Serializable
,EnvironmentHandler
Manages a list of match and replace rules for replacing values in string
attributes
- Version:
- $Revision: 11968 $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Inner class encapsulating the logic for matching and replacing. -
Constructor Summary
ConstructorDescriptionSubstringReplacerRules
(String matchDetails, Instances inputStructure) Constructor.SubstringReplacerRules
(String matchDetails, Instances inputStructure, String statusMessagePrefix, Logger log, Environment env) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyRules
(Instance inst) makeOutputInstance
(Instance inputI) Make an output instance given an input onematchRulesFromInternal
(String matchReplaceDetails, Instances inputStructure, String statusMessagePrefix, Logger log, Environment env) Get a list of match rules from an internally encoded match specificationvoid
Set environment variables to use.
-
Constructor Details
-
SubstringReplacerRules
public SubstringReplacerRules(String matchDetails, Instances inputStructure, String statusMessagePrefix, Logger log, Environment env) Constructor- Parameters:
matchDetails
- the internally encoded match details stringinputStructure
- the incoming instances structurestatusMessagePrefix
- an optional status message prefix string for logginglog
- the log to use (may be null)env
- environment variables
-
SubstringReplacerRules
Constructor. Initializes with system-wide environment variables and uses no status message and no log.- Parameters:
matchDetails
- the internally encoded match details stringinputStructure
- the incoming instances structure
-
-
Method Details
-
setEnvironment
Description copied from interface:EnvironmentHandler
Set environment variables to use.- Specified by:
setEnvironment
in interfaceEnvironmentHandler
- Parameters:
env
- the environment variables to use
-
matchRulesFromInternal
public static List<SubstringReplacerRules.SubstringReplacerMatchRule> matchRulesFromInternal(String matchReplaceDetails, Instances inputStructure, String statusMessagePrefix, Logger log, Environment env) Get a list of match rules from an internally encoded match specification- Parameters:
matchReplaceDetails
- the internally encoded specification of the match rulesinputStructure
- the input instances structurestatusMessagePrefix
- an optional status message prefix for logginglog
- the log to useenv
- environment variables- Returns:
- a list of match rules
-
applyRules
-
makeOutputInstance
Make an output instance given an input one- Parameters:
inputI
- the input instance to process- Returns:
- the output instance with substrings replaced
-