I think a lot of Python people have seen Peter Novig's beautiful article about How to Write a Spelling Corrector. So have I and couldn't wait to write my own little version of it to fit my needs.
The changes I added were:
- Python 2.4 compatible
- Uses a pickleable
dict
instead of a collection - Compiled a huge list of Swedish words
- Skipped edit distances 2 of words longer than 10 characters
- Added a function
suggestions()
- All Unicode instead
- A class instead of a function
- Ability to train on your own words and to save that training persistently