I wonder how Google find the exact word, even if we mistyped it in search box. I want to know if such open source algorithm is available?
-
1Possible duplicate: http://stackoverflow.com/questions/307291/how-does-the-google-did-you-mean-algorithm-work – jamesaharvey Oct 12 '09 at 11:50
-
2Google actually collects information about users who search for a mistyped word, don't find what they search for and then correct the word. They simply crush the problem with tons and tons of data. So if 100 people mistype "searech", find nothing and then type "search", then Google knows that "search" is a very probably correct spelling of "searech". – Joachim Sauer Oct 12 '09 at 11:51
-
1@vipin k., @Damien - was that missspellling of the tittle deliberete? – Dominic Rodger Oct 12 '09 at 12:01
5 Answers
Check out Peter Norvig's How to Write a Spelling Corrector article.

- 42,588
- 16
- 104
- 136
-
1+1 - though I'm quietly chuffed at myself for posting the exact same link 1 second earlier! – Dominic Rodger Oct 12 '09 at 11:50
Take a look at this Python Implementation of a suggester, which implements something similar (though no doubt not as clever as Google's) to what Google does.

- 97,747
- 36
- 197
- 212
Reading the Wikipedia entry on Levenshtein distance should give you a better idea of how to detect misspellings.

- 14,023
- 15
- 52
- 63
-
1I've used Levenshtein distance divided by length of original word as a crude measure of typing accuracy in the past. – Dominic Rodger Oct 12 '09 at 12:04
Or if you're using java, check out Compass's support of the "Did you mean feature", and also this blogpost containing an improvement to the original feature.

- 3,272
- 7
- 37
- 49
Actually Google uses a different algorithm. How does the Google "Did you mean?" Algorithm work?
If I search for poeple, I will probably realize my mistake and then search for people. Google tracks these trends and when you search for a word that many people usually look for a similar word afterward it suggests this word to you on your first search.