From bcde9e2fe7a47b659ddcfad9c0beb2ba624bf432 Mon Sep 17 00:00:00 2001 From: Al Date: Sat, 10 Sep 2016 00:49:31 -0400 Subject: [PATCH] [fix] toponym abbreviations after country name, may want to use it --- scripts/geodata/openaddresses/formatter.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/geodata/openaddresses/formatter.py b/scripts/geodata/openaddresses/formatter.py index 763731e5..f69aac50 100644 --- a/scripts/geodata/openaddresses/formatter.py +++ b/scripts/geodata/openaddresses/formatter.py @@ -375,6 +375,11 @@ class OpenAddressesFormatter(object): components.pop(AddressFormatter.UNIT) unit = None + # CLDR country name + country_name = self.cldr_country_name(country, language, configs) + if country_name: + components[AddressFormatter.COUNTRY] = country_name + for component_key in AddressFormatter.BOUNDARY_COMPONENTS: component = components.get(component_key, None) if component is not None: @@ -382,11 +387,6 @@ class OpenAddressesFormatter(object): abbreviate_prob=abbreviate_toponym_prob) components[component_key] = component - # CLDR country name - country_name = self.cldr_country_name(country, language, configs) - if country_name: - components[AddressFormatter.COUNTRY] = country_name - # Any components specified to be added by the config (usually state) if add_components: for k, v in six.iteritems(add_components):