Pasta News Network - New Zealand





How to Write a Spelling Corrector

Peter Norvig (US) 01/02/2007

One week in 2007, two friends (Dean and Bill) independently told me they were amazed at Google's spelling correction. Type in a search like [speling] and Google instantly comes back with Showing results for: spelling. I thought Dean and Bill, being highly accomplished engineers and mathematicians, would have good intuitions about how this process works. But they didn't, and come to think of it, why should they know about something so far outside their speciality?

I figured they, and others, could benefit from an explanation. The full details of an industrial-strength spell corrector are quite complex. But I figured that in the course of a transcontinental plane ride I could write and explain a toy spelling corrector that achieves 80 or 90% accuracy at a processing speed of at least 10 words per second in about half a page of code.

Noice. Spell checking is one of those under-appreciated modern creature comforts that everyone takes for granted nowadays. (Just like how typeset letters "magically" appear on your screen.)

Also check out the rest of his web-page.

Tags: Programming · Python