query
On this page

levenshtein

lib.strings.levenshtein

Docs pulled from | This Revision | 32 minutes ago


Computes the Levenshtein distance between two strings. Complexity O(n*m) where n and m are the lengths of the strings. Algorithm adjusted from https://stackoverflow.com/a/9750974/6605742

Inputs

a

1. Function argument

b

2. Function argument

Type

levenshtein :: string -> string -> int

Examples

levenshtein usage example

levenshtein "foo" "foo"
=> 0
levenshtein "book" "hook"
=> 1
levenshtein "hello" "Heyo"
=> 3