Skip to contents

Replace terms in a given string using a dictionary, with intelligent matching and case-insensitive handling.

Usage

harmonize_terms(dictionary, x, mode = "word", fallback = FALSE)

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

Examples

if (FALSE) { # \dontrun{
harmonize_terms(
  dictionary = "path/to/dictionary.csv",
  x = "Some text with specific terms"
)
} # }