From 185a410bf202a8d42422ad513ed0148ee2d2b101 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Sat, 4 Feb 2017 15:55:28 +0100 Subject: [PATCH] jaro and jaro_winkler should return float --- jellyfish/_jellyfish.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jellyfish/_jellyfish.py b/jellyfish/_jellyfish.py index 8d44bb9..d32b6d3 100644 --- a/jellyfish/_jellyfish.py +++ b/jellyfish/_jellyfish.py @@ -50,7 +50,7 @@ def _jaro_winkler(ying, yang, long_tolerance, winklerize): yang_len = len(yang) if not ying_len or not yang_len: - return 0 + return 0.0 min_len = max(ying_len, yang_len) search_range = (min_len // 2) - 1 @@ -73,7 +73,7 @@ def _jaro_winkler(ying, yang, long_tolerance, winklerize): # short circuit if no characters match if not common_chars: - return 0 + return 0.0 # count transpositions k = trans_count = 0