Compare two first names, with nickname, initial, and phonetic handling
compare_first_names.RdThe comparator used for the first_name field. Plain Jaro-Winkler is a poor
fit for given names in two ways: it misses nickname pairs (BOB vs ROBERT
score low) and it rarely drops below ~0.5 for unrelated names (so a genuinely
different first name adds little discriminating penalty). This comparator fixes
both:
exact match ->
1;nickname/diminutive of the same canonical (
nickname_table()) ->0.95;single initial vs full name ->
0.6if the initial agrees, else0(an initial is weak evidence, neither a match nor a strong mismatch);otherwise Jaro-Winkler rescaled by
(jw - floor) / (1 - floor)so unrelated names fall toward0and actually penalise, with a Soundex agreement raising the result to at least0.5(a sound-alike is not penalised, but – because Soundex over-collapses – is not asserted as a match either).