Levenshtein v0.3.0 Levenshtein View Source

For what is Levenshtein distance see:

https://en.wikipedia.org/wiki/Levenshtein_distance

Link to this section Summary

Functions

Returns an integer representing Levenshtein distance between source and target.

Link to this section Functions

Link to this function

distance(source, target) View Source
distance(String.t(), String.t()) :: non_neg_integer()

Returns an integer representing Levenshtein distance between source and target.

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.

The algorithm used is based on the Wagner-Fisher iterative implementation.

Examples

iex> Levenshtein.distance("kitten", "sitting")
3