On 2017-04-12 17:22, Mike wrote:
I found a Levenshtein function somewhere last year and have been using
it with MariaDB as a function on the MariaDB server, called from my
VFP 9 application. It's exceptionally fast and works pretty well.

My application needs to get "as close as" matches to a random string
(for manufacturer product SKUs, which can be any length, any
alphanumeric mishmash...example: RGB745WEHWW).

Sometimes the user enters everything right except one character, and
this function returns a weighted list of "as close as I can find"
known SKUs from a table of 45,000+.

I can send the function to anyone who is interested.

Here's an example of how I call it (the Levenshtien function is named
klose, pcSearch is the text string to search for)
    select sku, klose(sku,?pcSearch) as score
            from (select sku from skus where soundex(sku) like
soundex(?pcSearch)) as hits
            order by score desc limit 10

Mike Copeland




Hi Mike,

I'd love to see it. How about posting it on the ProFox downloads page so that it's easy for anybody to get?

Thanks!
--Mike


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to