This entry was posted on Tuesday, June 17th, 2008 at 3:38 am and is filed under development, howto. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
I always thought it was really cool to have those “Did you mean <some other spelling corrected word>”? Took me long enough to finally chance upon how it works! Basically it uses sound functions: soundex, metaphone or levenshtein distance to match words.
Different database supports different possible implementations of the functions. A sample mySQL query would look like:
SELECT `name` FROM `organizations` WHERE SOUNDEX(`name`) = SOUNDEX('dog');I’ve also seen some mysql stored procs that hack in a levenshtein distance calculation algorithm. This allows a even more dynamic and accurate match. Unfortunately, i’ve never gotten it to work. Do let me know if anyone has succeeded.
3 Responses to “HOWTO: Did you mean…”
Leave a Reply
Most Popular
- HOWTO: PHP and jQuery upload progress bar (48)
- JQuery Progress Bar 1.1 (42)
- Howto: Repackageable custom extension development in Magento - Part 2 - Admin Controller (24)
- Howto: Repackageable custom extension development in Magento - Part 8 - CRUD - Update (16)
- HOWTO: struts 2 i18n (13)
- JQuery Progress Bar 2.0 (12)
- JQuery Progress Bar 1.2 (11)
- Howto: Repackageable custom extension development in Magento (9)
- Howto: Repackageable custom extension development in Magento - Part 3 - Database (9)
- Howto: Repackageable custom extension development in Magento - Part 9 - Frontend - List (8)
Recent Comments
- vid: @john: Unfortunately there has been
- john: With facebook's growth, more and
- vid: Thanks for the mention Josefina
- vid: Thanks Remo. The idea was
- Remo: Oh man not again. This
- learning methods: All the posts you talk
- best travel agency: Wow! I really enjoyed this
- Muzafar Ali: Hi, thanks for sharing a beautiful
- andy65007: After the progress bar
- Mark: Excellent tutorials. Most "how to
Latest Entries
- Attack of the Facebook Harvesters
- jQuery Progress Bar Configuration
- Extracting email addresses from inbox
- 10 Good (Free and Legal) Source for Photos and Images
- Howto: Backup Microsoft SQL Server Database, as in Dump it to a SQL Script (like MYSQL's sqldump)
- Managing client's expectation with wireframe software
- Howto: Repackageable custom extension development in Magento - Part 9 - Frontend - List
- JQuery Progress Bar 2.0
- HOWTO: Find icons for your new prototype system
- Google Maps Helper
June 30th, 2009 at 1:18 pm
Please disregard / delete my prior comment (and this one also), as upon mousing over the links to the functions in the post I can now see that they lead to the PHP website making my prior comment kinda pointless.
June 30th, 2009 at 1:16 pm
Dunno exactly what you tend to use server-side, as I only just found your blog for the first time today, but in case you happen to use PHP, I thought I thought I’d mention that these functions are built in to PHP as well. Just one more place that one can look for this functionality besides their database. (I’m not sure, but I’d guess similar functions can also likely be found in or for Ruby, Python, and most common web scripting languages.)
October 10th, 2008 at 4:35 am
Really nice, I’ve been looking around for something like this.
Thanks