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.