closestWord {FastUtils} | R Documentation |
This function finds the closest word in a set of words to a given word based on a specified distance function.
closestWord(s, strset, distFunc = utils::adist)
s |
A character string. |
strset |
A set of character strings. |
distFunc |
A function to compute distance between strings.
Default is |
The closest word in the set to the given word.
# Find the closest word to "hello" in the set c("hallo", "hullo", "hey")
closestWord("hello", c("hallo", "hullo", "hey"))