levenshtein.damerau.distance: Compute Levenshtein-Damerau distances

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/levenshtein.damerau.distance.R

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

1
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.

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.

Value

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

Author(s)

Emmanuel Keuleers

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

1
2

Example output

Loading required package: stringdist
sh: 1: wc: Permission denied
sh: 1: cannot create /dev/null: Permission denied
Could not detect number of cores, defaulting to 1.
Loading required package: lattice
Loading required package: latticeExtra
Loading required package: RColorBrewer
                braque            f<U+00E9>es              quitteras 
                     6                      8                      9 
                clouez               usufruit         aga<U+00E7>ait 
                     7                      6                      8 
               supplia      vitup<U+00E9>rant r<U+00E9><U+00E9>coutent 
                     7                      9                      9 
              caboulot               sarroise                inclina 
                     7                      7                      8 
                roncet               meurtrie                minimum 
                     7                      6                      7 
sp<U+00E9>cialis<U+00E9>es                  gueux           incessamment 
                    11                      6                     12 
       masturb<U+00E9>             supposable 
                     8                      9 

vwr documentation built on May 2, 2019, 4:23 a.m.