[osm] Shortening state names obtained from reverse geocoding for relevant countries

This commit is contained in:
Al
2015-11-22 22:09:31 -05:00
parent 8b035814c7
commit 2695b5dd26
2 changed files with 13 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections import defaultdict
STATE_ABBREVIATIONS = {
'US': {
@@ -83,3 +84,10 @@ STATE_ABBREVIATIONS = {
'WA': {'en': 'Western Australia'},
},
}
STATE_EXPANSIONS = defaultdict(dict)
for country, values in STATE_ABBREVIATIONS.iteritems():
for abbrev, expansions in values.iteritems():
for lang, expansion in expansions.iteritems():
STATE_EXPANSIONS[country][expansion] = abbrev