optparse-applicative-0.18.0.0: Utilities and combinators for parsing command line options
Safe HaskellSafe-Inferred
LanguageHaskell98

Options.Applicative.Help.Levenshtein

Synopsis

Documentation

editDistance :: Eq a => [a] -> [a] -> Int Source #

Calculate the Damerau-Levenshtein edit distance between two lists (strings).

This is modified from https://wiki.haskell.org/Edit_distance and is originally from Lloyd Allison's paper "Lazy Dynamic-Programming can be Eager"

It's been changed though from Levenshtein to Damerau-Levenshtein, which treats transposition of adjacent characters as one change instead of two.

Complexity O(|a|*(1 + editDistance a b))