From bae04eb5439f092f3f0a40fb99b1c8352c07a447 Mon Sep 17 00:00:00 2001 From: Al Date: Sun, 28 Aug 2016 14:11:25 -0400 Subject: [PATCH] [fix] int --- scripts/geodata/address_expansions/abbreviations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/geodata/address_expansions/abbreviations.py b/scripts/geodata/address_expansions/abbreviations.py index 4717f3ca..048a2d8b 100644 --- a/scripts/geodata/address_expansions/abbreviations.py +++ b/scripts/geodata/address_expansions/abbreviations.py @@ -94,7 +94,7 @@ def abbreviate(gazetteer, s, language, abbreviate_prob=0.3, separate_prob=0.2, a abbreviated = [] # Append the original tokens with whitespace if there is any - if random.random() > abbreviate_prob or not any((is_canonical and lang in (language, 'all') for lang, dictionary, is_canonical, canonical in data)): + if random.random() > abbreviate_prob or not any((int(is_canonical) and lang in (language, 'all') for lang, dictionary, is_canonical, canonical in data)): for j, (t_i, c_i) in enumerate(t): abbreviated.append(tokens[i + j][0]) if i + j < n - 1 and raw_tokens[i + j + 1][0] > sum(raw_tokens[i + j][:2]):