Michael Schlenker-4 wrote:
> 
> htizo schrieb:
>> G'day,
>> Using sqlitev2.8.17 in php5 is there a way to look up a table for similar
>> strings (case insensitive)?
>> i.e. If I have the string "BLADEcatcher"
>> I want to find "blade_catcher" or "bladecatcher1" or even "bladecatcha"
>> so say 60% - 70% of characters the same.
> 
> sqlite 2.8.17 is from the stoneage..., why not use something more recent?
> 
> There are various options here.
> Not sure what would work with 2.8.17 though...
> 
> - use fulltext search support fts3 and hope the tokenizer/stemmer does
>   something useful to your strings
> 
> - use the soundex() function to calculate soundex values for your stored
>   strings and try to match with the soundex value of your search string
> 
> - write your own similarity function and use it like soundex() or in a
>   having clause.
> 
> - explode your stored strings into bi- or trigrams of letters and match
>   those
> 
> Typical thing to look for is Levenshtein distance, which you might know
> from
> PHP http://de3.php.net/levenshtein,
> n-gram matching http://en.wikipedia.org/wiki/N-gram
> 
> I would guess that n-gram matching is your best bet...
> 
> Michael
> 
> -- 
> Michael Schlenker
> Software Engineer
> 
> CONTACT Software GmbH           Tel.:   +49 (421) 20153-80
> Wiener Straße 1-3               Fax:    +49 (421) 20153-41
> 28359 Bremen
> http://www.contact.de/          E-Mail: m...@contact.de
> 
> Sitz der Gesellschaft: Bremen
> Geschäftsführer: Karl Heinz Zachries, Ralf Holtgrefe
> Eingetragen im Handelsregister des Amtsgerichts Bremen unter HRB 13215
> 


G'day Michael,
Thank you for your reply.
My kids tell me I'm from the stone age so 2.8 should suit me well :-)
Actually it's the version installed by Debian Stable. I'm just introducing
myself to sqlite but have already found 1 reason to upgrade, so it is on the
cards, but for other reasons not yet.

Full Text Search (FTS1-3) is now another reason if I can work out how to
compile it. Thank you for introducing me to FTS3, Soundex() and levenshtein.
I need to look at n-gram further. Now I have a short (or long) learning
journey that looks rather fascinating. I'll send you the bill for my
headache painkillers.

Your reply was just what I hoped for. Thank you very much.

warm regards,
build




-- 
View this message in context: 
http://www.nabble.com/Finding-similar-strings-tp21351608p21363934.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to