Class SubstringReplacerRules

java.lang.Object
weka.gui.beans.SubstringReplacerRules
All Implemented Interfaces:
Serializable, EnvironmentHandler

public class SubstringReplacerRules extends Object implements EnvironmentHandler, Serializable
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:
  • Constructor Details

    • SubstringReplacerRules

      public SubstringReplacerRules(String matchDetails, Instances inputStructure, String statusMessagePrefix, Logger log, Environment env)
      Constructor
      Parameters:
      matchDetails - the internally encoded match details string
      inputStructure - the incoming instances structure
      statusMessagePrefix - an optional status message prefix string for logging
      log - the log to use (may be null)
      env - environment variables
    • SubstringReplacerRules

      public SubstringReplacerRules(String matchDetails, Instances inputStructure)
      Constructor. Initializes with system-wide environment variables and uses no status message and no log.
      Parameters:
      matchDetails - the internally encoded match details string
      inputStructure - the incoming instances structure
  • Method Details

    • setEnvironment

      public void setEnvironment(Environment env)
      Description copied from interface: EnvironmentHandler
      Set environment variables to use.
      Specified by:
      setEnvironment in interface EnvironmentHandler
      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 rules
      inputStructure - the input instances structure
      statusMessagePrefix - an optional status message prefix for logging
      log - the log to use
      env - environment variables
      Returns:
      a list of match rules
    • applyRules

      public void applyRules(Instance inst)
    • makeOutputInstance

      public Instance makeOutputInstance(Instance inputI)
      Make an output instance given an input one
      Parameters:
      inputI - the input instance to process
      Returns:
      the output instance with substrings replaced