[osm] Only removing local language city if there are prior components from OSM
This commit is contained in:
@@ -654,8 +654,10 @@ def build_address_format_training_data(admin_rtree, language_rtree, neighborhood
|
|||||||
address_components[AddressFormatter.CITY] = city
|
address_components[AddressFormatter.CITY] = city
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
if non_local_language and AddressFormatter.CITY in address_components:
|
if non_local_language and AddressFormatter.CITY in address_components and (
|
||||||
_ = address_components.pop(AddressFormatter.CITY)
|
AddressFormatter.CITY_DISTRICT in osm_address_components or
|
||||||
|
AddressFormatter.SUBURB in address_components):
|
||||||
|
address_components.pop(AddressFormatter.CITY)
|
||||||
|
|
||||||
'''
|
'''
|
||||||
Neighborhoods
|
Neighborhoods
|
||||||
|
|||||||
Reference in New Issue
Block a user