@hackage language-spelling0.3.2

Various tools to detect/correct mistakes in words

Haskell library meant to be a set of tools to correct spelling mistakes, homophones, and OCR errors.

Sample session:

ghci> :m + Language.Distance.Search.BK
ghci> distance "foo" "bar" :: Distance DamerauLevenshtein
3
ghci> let bk = foldr insert empty ["foo", "foa", "fooa", "ofo", "arstu", "nana", "faa"] :: BKTree String DamerauLevenshtein
ghci> query 0 "foo" bk
[("foo",Distance 0)]
ghci> query 2 "foo" bk
[("faa",Distance 2),("foa",Distance 1),("fooa",Distance 1),("foo",Distance 0),("ofo",Distance 1)]

TODO:

  • Phonetic algorithms: metaphone, double metaphone, maybe others

  • Tests and better benchmarking

  • Cost tuning when searching