[formatting] Adding city_district as a separate format tag
This commit is contained in:
@@ -39,12 +39,26 @@ class AddressFormatter(object):
|
||||
HOUSE_NUMBER = 'house_number'
|
||||
ROAD = 'road'
|
||||
SUBURB = 'suburb'
|
||||
CITY_DISTRICT = 'city_district'
|
||||
CITY = 'city'
|
||||
STATE = 'state'
|
||||
STATE_DISTRICT = 'state_district'
|
||||
POSTCODE = 'postcode'
|
||||
COUNTRY = 'country'
|
||||
|
||||
address_formatter_fields = set([
|
||||
HOUSE,
|
||||
HOUSE_NUMBER,
|
||||
ROAD,
|
||||
SUBURB,
|
||||
CITY,
|
||||
CITY_DISTRICT,
|
||||
STATE,
|
||||
STATE_DISTRICT,
|
||||
POSTCODE,
|
||||
COUNTRY,
|
||||
])
|
||||
|
||||
aliases = OrderedDict([
|
||||
('name', HOUSE),
|
||||
('addr:housename', HOUSE),
|
||||
@@ -86,13 +100,15 @@ class AddressFormatter(object):
|
||||
('hamlet', CITY),
|
||||
('neighborhood', SUBURB),
|
||||
('neighbourhood', SUBURB),
|
||||
('city_district', SUBURB),
|
||||
('city_district', CITY_DISTRICT),
|
||||
('state_code', STATE),
|
||||
('country_name', COUNTRY),
|
||||
('postal_code', POSTCODE),
|
||||
('post_code', POSTCODE),
|
||||
])
|
||||
|
||||
prioritized_aliases = {k: i for i, k in enumerate(aliases)}
|
||||
|
||||
MINIMAL_COMPONENT_KEYS = [
|
||||
(ROAD, HOUSE_NUMBER),
|
||||
(ROAD, HOUSE),
|
||||
|
||||
Reference in New Issue
Block a user