levenshtein | R Documentation |
Measure the Levenshtein edit distance between strings
levenshtein(string1, string2, case = TRUE, damerau = FALSE, map = NULL,
motif = FALSE, fastMode = TRUE)
levenshteinDistanceMatrix(stringVector, case = TRUE, damerau = FALSE,
map = NULL, motif = FALSE, diagonalValue = 0, verbose = TRUE)
fastLeven.C( string1, string2)
string1 , string2 |
character strings to measure edit distance between |
stringVector |
character vector to measure all pairwise edit distances of |
case |
be case sensitive |
damerau |
Demerau enhancement, swap of adjacent letters costs 1 instead of 2 |
map |
character vector of regular expression modifiers |
motif |
when true, a single letter replacement costs 2, as a 'remove then insert' |
diagonalValue |
a numeric value to be assigned for a string's distance to itself |
verbose |
when true, print a small message to show progress to std out |
For levenshtein
, a numeric scalar that is the number of character edits
needed to turn string1
into string2
.
For levenshteinDistanceMatrix
, a square symmetric numeric matrix of size
N = length(stringVector)
, where each element is the number of character edits
between the corresponding 2 strings of stringVector
, with explicit diagonal
elements set to value diagonalValue
.
For levenshtein
, a numeric scalar that is the number of character edits
needed to turn string1
into string2
. This is a faster re-write in C.
Written by: Hans-Joerg Bibiko bibiko@eva.mpg.de
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.