Class SubstringReplacerRules

    • Constructor Detail

      • 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 Detail

      • 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