Two accomplished engineers told Norvig they were amazed by Google's spelling correction and had no idea how it worked. He wrote this on the flight home to show that the core is small: a probability model of words, a way to generate nearby spellings, and the rule that the best correction is the most probable candidate.
Norvig set himself a goal of 80 to 90 percent accuracy in about half a page of code and reached the half page with 68 to 75 percent. The piece is here for how it reads: the columns of edits1 line up so that the four kinds of edit can be compared by eye, the docstrings are sentences, and the whole argument from Bayes' rule to working program fits on one screen. It has been ported to more than thirty languages, and for many programmers it was the first time machine learning looked like something they could write themselves.