Spell checking from Python

I needed to find a spell checker I could call from Python, so I did a Google search and ran across GNU aspell. I tried installing it but got contradictory warning messages: aspell not installed, aspell already installed, etc. Then I remembered what an awful time I’d had before when I’d tried to use aspell and gave up.

Next I tried Ryan Kelly’s PyEnchant and it worked like a charm. I downloaded the installer for Windows and ran it. Then I opened up a Python console and typed an example following the online tutorial.

>>> import enchant
>>> d = enchant.Dict("en_US")
>>> d.check("Potatoe")
False
>>> d.check("Potato")
True

It just works.

Tagged with: ,
Posted in Python
3 comments on “Spell checking from Python
  1. B Riley says:

    In case you have never seen this, Peter Norvig has a wonderful essay on developing a spell checker in Python:
    http://www.norvig.com/spell-correct.html

  2. Dan Quayle says:

    There seems to be a problem with that program getting things backward. I don’t think I would truste it.

    – Dan Quayle