jaro and jaro_winkler should return float

This commit is contained in:
Jonathan 2017-02-04 15:55:28 +01:00
parent 2d23592216
commit 185a410bf2
1 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ def _jaro_winkler(ying, yang, long_tolerance, winklerize):
yang_len = len(yang) yang_len = len(yang)
if not ying_len or not yang_len: if not ying_len or not yang_len:
return 0 return 0.0
min_len = max(ying_len, yang_len) min_len = max(ying_len, yang_len)
search_range = (min_len // 2) - 1 search_range = (min_len // 2) - 1
@ -73,7 +73,7 @@ def _jaro_winkler(ying, yang, long_tolerance, winklerize):
# short circuit if no characters match # short circuit if no characters match
if not common_chars: if not common_chars:
return 0 return 0.0
# count transpositions # count transpositions
k = trans_count = 0 k = trans_count = 0