From ed77ceead3414e64fb227f28ea70db008b70c103 Mon Sep 17 00:00:00 2001 From: Al Date: Sat, 2 Jul 2016 04:24:07 -0400 Subject: [PATCH] [addresses] Adding some of the new configs and returning None if no phrase alternatives exist --- scripts/geodata/addresses/config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/geodata/addresses/config.py b/scripts/geodata/addresses/config.py index d61e8265..44651d03 100644 --- a/scripts/geodata/addresses/config.py +++ b/scripts/geodata/addresses/config.py @@ -26,7 +26,7 @@ class AddressConfig(object): self.cache = {} for filename in os.listdir(config_dir): - if filename not in ('en.yaml', 'es.yaml', 'ca.yaml', 'fr.yaml', 'de.yaml', 'nl.yaml', 'da.yaml', 'nb.yaml', 'sv.yaml', 'pt.yaml', 'pl.yaml', 'ru.yaml', 'cs.yaml', 'sk.yaml', 'it.yaml'): + if filename not in ('en.yaml', 'es.yaml', 'ca.yaml', 'fr.yaml', 'de.yaml', 'nl.yaml', 'da.yaml', 'nb.yaml', 'sv.yaml', 'pt.yaml', 'pl.yaml', 'ru.yaml', 'cs.yaml', 'sk.yaml', 'it.yaml', 'et.yaml', 'fi.yaml', 'ro.yaml', 'hu.yaml'): continue config = yaml.load(open(os.path.join(ADDRESS_CONFIG_DIR, filename))) @@ -78,6 +78,8 @@ class AddressConfig(object): return None, None alternatives, probs = alternative_probabilities(properties) + if alternatives is None: + return None, None forms = [] form_probs = []