[languages] using country_and_languages method in OSM, neighborhoods and OpenAddresses

This commit is contained in:
Al
2016-10-05 02:49:55 -04:00
parent 98a8d898a1
commit faf418decb
7 changed files with 95 additions and 88 deletions

View File

@@ -67,9 +67,9 @@ class OpenAddressesFormatter(object):
re.I | re.UNICODE)
unit_type_regexes[lang] = pattern
def __init__(self, components, debug=False):
def __init__(self, components, country_rtree, debug=False):
self.components = components
self.language_rtree = components.language_rtree
self.country_rtree = country_rtree
self.debug = debug
@@ -309,7 +309,7 @@ class OpenAddressesFormatter(object):
continue
if components:
country, candidate_languages, language_props = self.language_rtree.country_and_languages(latitude, longitude)
country, candidate_languages = self.country_rtree.country_and_languages(latitude, longitude)
if not (country and candidate_languages):
continue