I am looking for a fast solution in R for determining word-level edit distance between two sentences. More specifically, I want to determine minimal number of additions, substitutions or deletions of words, to transform sentence A to sentence B. For example, if sentence A is "very nice car" and sentence B is "nice red car", the result should be 2 (1 deletion and 1 addition).
I know that there are existing solutions in R for character-level edit distance (e.g., native adist()
and stringdist()
from package 'stringdist'), but I found none for word-level.