wxSpellTextCtrl on-the-fly spell checking for wxPython

gb at cs.unc.edu gb at cs.unc.edu
Fri Jul 20 16:42:40 EDT 2001


I have hacked together a primitive on-the-fly spell checker for the
wxPython wxTextCtrl using the new SetStyle feature.

I would like to get some feedback and help on this code. It is
surprisingly tricky to make spell checking on the fly work in a
pleasing way. I am sure there are still bugs in this version.

You can pick up an archive of the code at

http://www.cs.unc.edu/~gb/wxSpellTextCtrl.zip

You'll need aspell or ispell to use it. The path is hardwired in the
code so unless you have aspell installed as c:/aspell/aspell.exe
you'll have to get your hands dirty to try this.

The algorithm is loosely based on the flyspell package for
emacs. Misspelled words are colored red. Right clicking on a
misspelled word will pop up a menu allowing you to add the word to
your local dictionary or to replace it with one of several suggested
words. 

Send email if you are interested in collaborating on this code. 

This code and the resulting final product can be used by anyone for
any purpose with no restrictions.

gb





More information about the Python-list mailing list