Class MultipleTextReplacementMultiReturn
java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.util.MultipleTextReplacementMultiReturn
Replace multiple texts at once.
Returns multiple possible variants. Especially used for replacing synonyms.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMultipleTextReplacementMultiReturn
(List<Map.Entry<String, Set<String>>> replacements, boolean wholeWordsOnly) Initializes this object with a list of replacements.MultipleTextReplacementMultiReturn
(Map<String, Set<String>> replacements) MultipleTextReplacementMultiReturn
(Map<String, Set<String>> replacements, boolean wholeWordsOnly) Initializes this object with a replacement map. -
Method Summary
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
pattern
-
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
-
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
-
-
Method Details
-
replace
-
append
-