From b190c88cc14048914d8d7452174e015ae2339af7 Mon Sep 17 00:00:00 2001 From: Al Date: Thu, 5 May 2016 13:29:15 -0400 Subject: [PATCH] [fix] state --- scripts/geodata/addresses/components.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/geodata/addresses/components.py b/scripts/geodata/addresses/components.py index 80eb7f2f..beac924f 100644 --- a/scripts/geodata/addresses/components.py +++ b/scripts/geodata/addresses/components.py @@ -203,6 +203,7 @@ class AddressExpander(object): component_names = self.all_names(props, languages=languages) names |= component_names + is_state = False for k, v in six.iteritems(props): normalized_key = osm_address_components.get_component(country, k, v) if not normalized_key: @@ -210,7 +211,11 @@ class AddressExpander(object): for cn in component_names: components[cn.lower()].add(normalized_key) - if normalized_key == AddressFormatter.STATE: + if normalized_key == AddressFormatter.STATE and not is_state: + is_state = True + + if is_state: + for state in component_names: for language in languages: state_code = state_abbreviations.get_abbreviation(country, language, state) if state_code: