help need to write a python spell checker
Tim Chase
python.list at tim.thechases.com
Sat May 15 07:02:06 EDT 2010
> 2) Python-list doesn't like to do other people's homework.
This could be fun... :) For this problem, all you have to do is
a big "if/elif/else" statement for every possible mis-spelling.
If you want to get really fancy, you could put all the
mis-spellings in a set() and then test the incoming word against
the set for membership...For bonus points, you could use the
anydbm module as a mapping from known-bad-spellings to the
correct spelling so it can auto-correct for you...
Then you know if the word is mis-spelled. The rest is pretty
easy. ;-)
-tkc
(or maybe this only sounds amusing if you're sleep-deprived, up
with your kid in the wee hours of the morning when you'd prefer
to be snoozing)
More information about the Python-list
mailing list