[Haskell-cafe] Haskell version of Norvig's Python Spelling Corrector

Pete Kazmier pete-expires-20070615 at kazmier.com
Sat Apr 21 17:42:59 EDT 2007

Recently I read an interesting article by Peter Norvig[1] on how to
write a spelling corrector in 21-lines of Python.  I wanted to try and
implement it in Haskell.  My implementation is terribly slow and I was
hoping for some tips on how to improve it and make it idiomatic.

I'd love to see other Haskell implementations as well if anyone has a
few moments to spare.  Admittedly, it took me several hours to get my
version working, but I'm a Haskell newbie.  Unfortunately, I think it
runs as slow as it took me to write it!  There is definitely something
wrong with it, a memory leak, because I can't correct more than a few
words without a great deal of memory being consumed.


[1] http://norvig.com/spell-correct.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: spell.hs
Type: text/x-haskell
Size: 2114 bytes
Desc: Spelling Corrector
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20070421/07c3a62f/spell.bin

More information about the Haskell-Cafe mailing list