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 _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users