java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.util.MultipleTextReplacement

public class MultipleTextReplacement extends Object
Replace multiple texts at once.
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • pattern

      private Pattern pattern
    • replacementLookup

      private Map<String,String> replacementLookup
  • Constructor Details

    • MultipleTextReplacement

      public MultipleTextReplacement(List<Map.Entry<String,String>> replacements, boolean wholeWordsOnly)
      Initializes this object with a list of replacements. The order is important. If the keys share the same prefix the one which comes first is used for replacement. E.g. aa -> x and aaa -> y and input will be aaa, it will return aax
      Parameters:
      replacements - map where key is the text to search for and value is the replacement text.
      wholeWordsOnly - if true, matches only whole words. if false, then also text within a word can be matched
    • MultipleTextReplacement

      public MultipleTextReplacement(List<Map.Entry<String,String>> replacements)
      Initializes this object with a list of replacements. The order is important. If the keys share the same prefix the one which comes first is used for replacement. E.g. aa -> x and aaa -> y and input will be aaa, it will return aax
      Parameters:
      replacements - map where key is the text to search for and value is the replacement text.
    • MultipleTextReplacement

      public MultipleTextReplacement(Map<String,String> replacements, boolean wholeWordsOnly)
      Initializes this object with a replacement map.
      Parameters:
      replacements - map where key is the text to search for and value is the replacement text.
      wholeWordsOnly - if true, matches only whole words. if false, then also text within a word can be matched
    • MultipleTextReplacement

      public MultipleTextReplacement(Map<String,String> replacements)
      Initializes this object with a replacement map.
      Parameters:
      replacements - map where key is the text to search for and value is the replacement text.
  • Method Details