[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
guile-aspell : spellchecking wth Guile
From: |
Mike Gran |
Subject: |
guile-aspell : spellchecking wth Guile |
Date: |
Sat, 5 Dec 2009 18:40:00 -0800 (PST) |
Hi-
I wrote a bit of glue code for Guile and Gnu Aspell, a spellchecking library.
I packaged it as a Guile library and saved it at
http://www.lonelycactus.com/aspell.html
I've only tried to build it on Guile 1.8.x on i686-pc-linux-gnu and
i686-pc-cygwin.
For the small amount of effort, it actually came out pretty useful.
Here it is in action:
-----------
$ LTDL_LIBRARY_PATH=/usr/local/lib guile -L /usr/local/share/guile/site
guile> (use-modules (aspell aspell))
guile> (aspell-set-lang "en_US")
#t
guile> (aspell-correct? "recieve") ; check if it is a word
#f
guile> (aspell-word "recieve") ; get some possibilities
("receive" "receiver" "Recife" "relieve" "received" "receives" "revive" "reeve"
"reserve" "deceive" "reliever" "recede" "recipe" "recite" "relive")
guile> (aspell-add-word "recieve") ; add the word to the dictionary
#t
guile> (aspell-word "flem")
("Flem" "fl em" "fl-em" "Lem" "fem" "flam" "flea" "flee" "flew" "Clem" "elem" "f
led" "Flem's")
guile> (aspell-store-replacement "flem" "phlegm") ; add a preferred replacement
#t
guile> (aspell-word "flem")
("Flem" "phlegm" "fl em" "fl-em" "Lem" "fem" "flam" "flea" "flee" "flew" "Clem"
"elem" "fled" "Flem's")
-----------
Thanks,
Mike Gran
- guile-aspell : spellchecking wth Guile,
Mike Gran <=