Go to main content

levenshtein

Return the distance between 2 strings.

levenshtein

NAME

levenshtein - Return the distance between 2 strings.

SYNOPSIS

levenshtein(string1,string2)

DESCRIPTION

From Wikipedia: In information theory and computer science, the Levenshtein distance is a string metric for measuring the difference between two sequences. Informally, the Levenshtein distance between two words is the minimum number of single-character edits (i.e. insertions, deletions or substitutions) required to change one word into the other. It is named after Vladimir Levenshtein, who considered this distance in 1965.[1] Levenshtein distance may also be referred to as edit distance, although that may also denote a larger family of distance metrics.[2]:32 It is closely related to pairwise string alignments.

RETURN

Return an integer.

EXAMPLES

            levenshtein("extenso","extenso");

            levenshtein("extenso","extens0");

            levenshtein("extenso","exten50");

            levenshtein("extenso","exte350");

            levenshtein("extenso","ext4350");

            levenshtein("extenso","ex54350");

            levenshtein("extenso","e654350");

            levenshtein("extenso","7654350");

            levenshtein("extenso","87654350");

return 012345678

SEE ALSO

{{ include("includes/strings.sn") }}

AUTHOR

Written by Pierre Laplante, <laplante@sednove.com>

MODIFICATIONS

1.0 2016-03-08 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.