closestWord {FastUtils} | R Documentation |
Find the Closest Word in a Set to a Given Word
Description
This function finds the closest word in a set of words to a given word based on a specified distance function.
Usage
closestWord(s, strset, distFunc = utils::adist)
Arguments
s |
A character string. |
strset |
A set of character strings. |
distFunc |
A function to compute distance between strings. Default is |
Value
The closest word in the set to the given word.
Examples
# Find the closest word to "hello" in the set c("hallo", "hullo", "hey")
closestWord("hello", c("hallo", "hullo", "hey"))
[Package FastUtils version 0.1.1 Index]