[fix] now that neighborhood is classified at index construction time, no longer need to assume suburb for components that might otherwise be a city, etc.

This commit is contained in:
Al
2016-12-22 23:21:01 -05:00
parent 481bc248a1
commit 00f3f3f94d

View File

@@ -1000,7 +1000,7 @@ class AddressComponents(object):
polygon_type = neighborhood.get('polygon_type') polygon_type = neighborhood.get('polygon_type')
component = neighborhood.get('component') component = neighborhood.get('component')
neighborhood_level = AddressFormatter.SUBURB neighborhood_level = component
key, raw_key = self.pick_random_name_key(neighborhood, neighborhood_level, suffix=language_suffix) key, raw_key = self.pick_random_name_key(neighborhood, neighborhood_level, suffix=language_suffix)
@@ -1008,8 +1008,6 @@ class AddressComponents(object):
name = neighborhood.get(key, neighborhood.get(raw_key)) name = neighborhood.get(key, neighborhood.get(raw_key))
if component == AddressFormatter.CITY_DISTRICT: if component == AddressFormatter.CITY_DISTRICT:
neighborhood_level = AddressFormatter.CITY_DISTRICT
# Optimization so we don't use e.g. same name multiple times for suburb, city_district, city, etc. # Optimization so we don't use e.g. same name multiple times for suburb, city_district, city, etc.
if not replace_city and name == city_name and (not standard_name or standard_name == city_name): if not replace_city and name == city_name and (not standard_name or standard_name == city_name):
continue continue