Class MultipleTextReplacementMultiReturn

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

public class MultipleTextReplacementMultiReturn extends Object
Replace multiple texts at once. Returns multiple possible variants. Especially used for replacing synonyms.
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • pattern

      private Pattern pattern
    • replacementLookup

      private Map<String,Set<String>> replacementLookup
  • Constructor Details

    • MultipleTextReplacementMultiReturn

      public MultipleTextReplacementMultiReturn(List<Map.Entry<String,Set<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
    • MultipleTextReplacementMultiReturn

      public MultipleTextReplacementMultiReturn(List<Map.Entry<String,Set<String>>> replacements)
    • MultipleTextReplacementMultiReturn

      public MultipleTextReplacementMultiReturn(Map<String,Set<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
    • MultipleTextReplacementMultiReturn

      public MultipleTextReplacementMultiReturn(Map<String,Set<String>> replacements)
  • Method Details