HOW TO: Coding a Statistical Spellcheck

Technology
HOW TO: Coding a Statistical Spellcheck

spellcheck_20070409.jpg
Have you ever been curious about how some applications, such as MS Word or Google, can return spelling suggestions so quickly and accurately?

Chances are, they are using a fairly straightforward probabilistic model, trained on a sample dictionary of common words and phrases, to determine when a word has been misspelled and to suggest the most likely alternate spelling. With a little effort and a small amount of code, you can add similar functionality to your own applications!

“Let’s get right to it. I figured that in less than a plane flight, and in less than a page of code, I could write a spelling corrector that achieves 80 or 90% accuracy at a rate of at least 10 words per second. And in fact, here, in 20 lines of Python 2.5 code, is the complete spelling corrector” –Link.

Related:

What will the next generation of Make: look like? We’re inviting you to shape the future by investing in Make:. By becoming an investor, you help decide what’s next. The future of Make: is in your hands. Learn More.

Tagged
Discuss this article with the rest of the community on our Discord server!

ADVERTISEMENT

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 16th iteration!

Prices Increase in....

Days
Hours
Minutes
Seconds
FEEDBACK