Wiki

Clone wiki

HAspell / Home

HAspell

Bindings to GNU Aspell library.

Status

Project is under development, but is usable now ;]

Example

> s <- initSpeller [ ("lang", "en_US") ]
> checkWord s "word"
True
> checkWord s "wor"
False
> suggest s "wor"
["woe","word","wore","work","worm","worn","wort","wot","OR","or","war","woo", "wow","wog","wok","won","wop","cor","for","nor","tor","xor"]

> storeReplacement s "wor" "xor"
> suggest s "wor"
["xor","woe","word","wore","work","worm","worn","wort","wot","OR","or","war", "woo","wow","wog","wok","won","wop","cor","for","nor","tor"]

> checkWord s "Ocaml"
False
> addToSession s "Ocaml"
> checkWord s "Ocaml"
True
> clearSession s
> checkWord s "Ocaml"
False

Aspell errors are mapped to Haskell exception.

*Text.Aspell> s <- initSpeller [ ("lang", "ufo") ]
*** Exception: AspellException 1 "No word lists can be found for the language \"ufo\"."

Updated