powered by
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)
The closest word in the set to the given word.
A character string.
A set of character strings.
A function to compute distance between strings. Default is utils::adist.
utils::adist
# Find the closest word to "hello" in the set c("hallo", "hullo", "hey") closestWord("hello", c("hallo", "hullo", "hey"))
Run the code above in your browser using DataLab