- data Distance algo
- getDistance :: Distance algo -> Int
- class EditDistance sym algo where
- data Levenshtein
- levenshtein :: (ListLike full sym, Eq sym) => full -> full -> Distance Levenshtein
- data DamerauLevenshtein
- damerauLevenshtein :: (ListLike full sym, Ord sym) => full -> full -> Distance DamerauLevenshtein
Generic typeclass for edit distances. Specify the type manually to use a specific algorithm, for instance
distance "foo" "bar" ::
The classic Levenshtein distance, where adding, removing or changing a character are taken into account.
More information: https://en.wikipedia.org/wiki/Levenshtein_distance.
Levenshtein, but transpositions are also taken into account: