Use a mixture of Soundex (or a variant) and the levenstein function. Essentially the Soundex function tries to combat a person not knowing how a word is spelt (but knowing how it sounds) and a levenstein distance algorithm tries to combat typos.