function JaroWinkler($string1, $string2, $PREFIXSCALE = 0.1) { $JaroDistance = Jaro($string1, $string2); $prefixLength = getPrefixLength($string1, $string2); return $JaroDistance + $prefixLength * $PREFIXSCALE * (1.0 - $JaroDistance); }
function JaroWinkler($string1, $string2, $toupper = false, $PREFIXSCALE = 0.1) { if ($toupper) { $string1 = strtoupper($string1); $string2 = strtoupper($string2); } $JaroDistance = Jaro($string1, $string2); $prefixLength = getPrefixLength($string1, $string2); return $JaroDistance + $prefixLength * $PREFIXSCALE * (1.0 - $JaroDistance); }