• Post Reply Bookmark Topic Watch Topic
  • New Topic

Google style "Did you mean" feature  RSS feed

 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Help!

I need to write a Google style "Did you mean" function built on SQL pretty quick, any quick hint, tips or sample codes for doing this?
 
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One aspect of this problem is when a user misspells or uses a word that sounds right but is gramatically wrong.

Years ago I wrote a phonetic lookup mechanism for a legal firm coping with court transcripts. Here is a demo and some discussion.
The Apache commons project has collected the several toolkits for phonetic lookup. (The commons project is a great source for a lot of tools.)
Bill
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which database are you using? Oracle 10g has a SOUNDEX function for phonetic string-based search.

Oracle FAQ : Soundex

Sid
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my less-than-humble opinion, Soundex is practically worthless. The guy who wrote the Metaphone algorithm that I implemented came to this conclusion years ago. Soundex is completely dependent on getting the first letter right so it can't detect the similarity of this common mixup:

cite
sight
site

Just for one example.
Bill
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!