Open Hasan-git opened 4 years ago
Can you expand your idea of "if it fit a minimum" ?
Sorry for being late, I have a contact records( name, phone and birthday), I am trying to figure a way to check if a contact is highly possible duplicate through these inputs against persisted contact records.
I am grateful for you!
is there a way to calculate Similarity Score relative to 1. Example : if searching for a name like "forda", I expect to get result as the image below
I have written a section on why I score the way I do. https://github.com/jeancroy/FuzzySearch#scoring-a-token-in-a-auto-complete-friendly-manner
I understand some of those assumptions are different from what you would want in a auto-de-duplication scenario.
You could score the query against itself and divide all the score by this maximal(?) one. See how far that takes you. If you want more basic LCS score, there's plenty of library that'll do that.
The individual word score works like this:
m = size A
n = size B
lcs_len = max number of character in common in proper order
prefix = max number of character in common at the start of word.
var sz = (m + n) / ( 2.0 m n); scores[k] = sz lcs_len lcs_len + bonus_prefix * prefix;
I need a way to specify the score result if it fit a minimum, I found that thresh_include not convenient in general, where it depends input length. I think I need to compare the score and its relativity to input length ?