RiotTown has asked for the wisdom of the Perl Monks concerning the following question:
I'm in the process of putting some anti-fraud tools into place for my company. Part of this is to compare strings from an input form against those already existing within a database (all free form). IE, comparing "Steven Smith" to "Stephen Smithe" and "Steve Smith". This isn't limited to names right now, just makes for easier explaining.
I've got an algorithm and query already set up to return rows that are close to the user-input text, but I'm running into problems displaying exactly how similar the two strings are for ranking purposes.
Currently I'm testing with good results the Levenshtein Distance algorithm. The problem is that this method is SLOW, especially when comparing longer strings. (info can be found here on the Levenshtein Distance algorithm.
Does anyone know of a faster way to get a meaningful representation of how closely two stings match?
I've got an algorithm and query already set up to return rows that are close to the user-input text, but I'm running into problems displaying exactly how similar the two strings are for ranking purposes.
Currently I'm testing with good results the Levenshtein Distance algorithm. The problem is that this method is SLOW, especially when comparing longer strings. (info can be found here on the Levenshtein Distance algorithm.
Does anyone know of a faster way to get a meaningful representation of how closely two stings match?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Comparing likeness of two strings
by waswas-fng (Curate) on Jan 19, 2005 at 20:29 UTC | |
Re: Comparing likeness of two strings
by VSarkiss (Monsignor) on Jan 19, 2005 at 20:24 UTC | |
Re: Comparing likeness of two strings
by Limbic~Region (Chancellor) on Jan 19, 2005 at 20:27 UTC | |
Re: Comparing likeness of two strings
by RiotTown (Scribe) on Jan 19, 2005 at 22:04 UTC | |
by RiotTown (Scribe) on Jan 19, 2005 at 22:15 UTC |
Back to
Seekers of Perl Wisdom