Replace terms in a given string using a dictionary, with intelligent matching
and case-insensitive handling.
Arguments
- dictionary
Path to the dictionary file or a data frame containing
replacement terms
- x
Character string to be cleaned
- mode
Replacement mode: 'word' for word boundary matching,
'substring' for partial matching
- fallback
Logical, whether to fall back to original string if
no replacements occur
Value
Character string with terms replaced