vwr (version 0.3.0)

levenshtein.damerau.distance: Compute Levenshtein-Damerau distances

Description

Compute the Levenshtein-Damerau distance between two character strings (the minimal number of insertions, deletions replacements, or transpositions required to transform one string into the other)

Usage

levenshtein.damerau.distance(xsource, targets)

Arguments

xsource
A character string to compute the Levenshtein-Damerau distance from.
targets
A list of words to compute the Levenshtein-Damerau distance to. Must be of type character, or convertible to type character with as.character.

Value

An integer vector containing Restricted Levenshtein-Damerau distances, with names corresponding to targets.

Details

The distance computation is performed by stringdist with method="osa". Note that this function computes the restricted Levenshtein-Damerau distance instead of the unrestricted version.

References

Damerau, F. J. (1964). A technique for computer detection and correction of spelling errors. Communications of the ACM, 7(3), 171—176.

See Also

levenshtein.neighbors,levenshtein.distance, stringdist, ald

Examples

Run this code
data(french.words)
levenshtein.damerau.distance('pourquoi',sample(french.words,20))

Run the code above in your browser using DataLab