URL: http://github.com/peterbe/django-spellcorrector/tree/master

I've now made a vastly improved spellcorrector specifically tied into Django and it's models. It's the old class as before but hooked up to models so Django can take care of persisting the trained words. Again, I have to give tribute to Peter Norvig for his inspirational blog How to Write a Spelling Corrector which a large majority of my code is based in. At least in the tricky parts.

What's nice about this little app is that it's very easy to plug in and use. You just download it, put it on your PATH and include it in your INSTALLED_APPS. Then from another app you do something like this:


from spellcorrector.views import Spellcorrector
sc = Spellcorrector()
sc.load() # nothing will happen the first time

sc.train(u"peter")
print sc.correct(u"petter") # will print peter
sc.save()

sc2 = Spellcorrector()
sc2.load()
print sc2.correct(u"petter") # will print peter

This is my first django-*** app I've wrapped up and released in github so I'm not even near certain that I've done it right.

I'll try to keep the project updated and more approachable but right now it works in one of my production sites so I'm confident the code is ok.

Screenshots

Introducing django-spellcorrector

Introducing django-spellcorrector

Introducing django-spellcorrector

Comments

Your email will never ever be published.

Previous:
Crossing the world - new feature on Crosstips May 23, 2009 Django
Next:
My dislike for booleans and that impact on the Django Admin June 1, 2009 Django
Related by category:
How to avoid a count query in Django if you can February 14, 2024 Django
How to have default/initial values in a Django form that is bound and rendered January 10, 2020 Django
My site's now NextJS - And I (almost) regret it already December 17, 2021 Django
How to sort case insensitively with empty strings last in Django April 3, 2022 Django
Related by keyword:
How to install Python Poetry in GitHub Actions in MUCH faster way July 27, 2021 Python
Train your own spell corrector with TextBlob August 23, 2019 Python
gg - A prototype to rule Git, GitHub and Bugzilla May 6, 2016 Python, Web development
Github Pull Request Triage tool March 6, 2014 Web development, AngularJS