[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'
|
HOUSE_NUMBER = 'house_number'
|
||||||
ROAD = 'road'
|
ROAD = 'road'
|
||||||
SUBURB = 'suburb'
|
SUBURB = 'suburb'
|
||||||
|
CITY_DISTRICT = 'city_district'
|
||||||
CITY = 'city'
|
CITY = 'city'
|
||||||
STATE = 'state'
|
STATE = 'state'
|
||||||
STATE_DISTRICT = 'state_district'
|
STATE_DISTRICT = 'state_district'
|
||||||
POSTCODE = 'postcode'
|
POSTCODE = 'postcode'
|
||||||
COUNTRY = 'country'
|
COUNTRY = 'country'
|
||||||
|
|
||||||
|
address_formatter_fields = set([
|
||||||
|
HOUSE,
|
||||||
|
HOUSE_NUMBER,
|
||||||
|
ROAD,
|
||||||
|
SUBURB,
|
||||||
|
CITY,
|
||||||
|
CITY_DISTRICT,
|
||||||
|
STATE,
|
||||||
|
STATE_DISTRICT,
|
||||||
|
POSTCODE,
|
||||||
|
COUNTRY,
|
||||||
|
])
|
||||||
|
|
||||||
aliases = OrderedDict([
|
aliases = OrderedDict([
|
||||||
('name', HOUSE),
|
('name', HOUSE),
|
||||||
('addr:housename', HOUSE),
|
('addr:housename', HOUSE),
|
||||||
@@ -86,13 +100,15 @@ class AddressFormatter(object):
|
|||||||
('hamlet', CITY),
|
('hamlet', CITY),
|
||||||
('neighborhood', SUBURB),
|
('neighborhood', SUBURB),
|
||||||
('neighbourhood', SUBURB),
|
('neighbourhood', SUBURB),
|
||||||
('city_district', SUBURB),
|
('city_district', CITY_DISTRICT),
|
||||||
('state_code', STATE),
|
('state_code', STATE),
|
||||||
('country_name', COUNTRY),
|
('country_name', COUNTRY),
|
||||||
('postal_code', POSTCODE),
|
('postal_code', POSTCODE),
|
||||||
('post_code', POSTCODE),
|
('post_code', POSTCODE),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
prioritized_aliases = {k: i for i, k in enumerate(aliases)}
|
||||||
|
|
||||||
MINIMAL_COMPONENT_KEYS = [
|
MINIMAL_COMPONENT_KEYS = [
|
||||||
(ROAD, HOUSE_NUMBER),
|
(ROAD, HOUSE_NUMBER),
|
||||||
(ROAD, HOUSE),
|
(ROAD, HOUSE),
|
||||||
|
|||||||
Reference in New Issue
Block a user