Word comparison algorithm
You might want to check out the Levenshtein Distance algorithm as a starting point. It will rate the “distance” between two words. This SO thread on implementing a Google-style “Do you mean…?” system may provide some ideas as well.