How to Write a Spelling Correction Program

This is an excellent article by Peter Norvig, a research director of Google.