MySQL Forums
Forum List  »  PHP

Re: Checking for exact match in row
Posted by: Rick James
Date: July 13, 2009 08:41PM

Here's a "close to" algorithm:
Create an extra table with 'used' names. Insert into it
* the names that exist
* the names that exist, but with the 1st letter removed
* the names that exist, but with the 2nd letter removed
* etc

Then, when a new name comes in, create a similar set of mangled names: cameron -> cameron , ameron, cmeron, caeron, camron, cameon, camern, camero
Look each of them up in the table; reject any hits.

This catches
* A single deleted letter.
* A single added letter.
* Swapped pair of adjacent letters.
* And some other "transcription" errors.

(This table would have several times as many rows as there are users. It could also contain the actual user name, if you want to see where it came from. And it will have some duplicates.)

Options: ReplyQuote


Subject
Written By
Posted
Re: Checking for exact match in row
July 13, 2009 08:41PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.