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?
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.