[expansion] Add postcode dictionary to gazetteer types
This commit is contained in:
@@ -92,6 +92,7 @@ gazetteer_types = {
|
|||||||
'personal_titles': 'DICTIONARY_PERSONAL_TITLE',
|
'personal_titles': 'DICTIONARY_PERSONAL_TITLE',
|
||||||
'place_names': 'DICTIONARY_PLACE_NAME',
|
'place_names': 'DICTIONARY_PLACE_NAME',
|
||||||
'post_office': 'DICTIONARY_POST_OFFICE',
|
'post_office': 'DICTIONARY_POST_OFFICE',
|
||||||
|
'postcode': 'DICTIONARY_POSTCODE',
|
||||||
'qualifiers': 'DICTIONARY_QUALIFIER',
|
'qualifiers': 'DICTIONARY_QUALIFIER',
|
||||||
'staircase': 'DICTIONARY_STAIRCASE',
|
'staircase': 'DICTIONARY_STAIRCASE',
|
||||||
'stopwords': 'DICTIONARY_STOPWORD',
|
'stopwords': 'DICTIONARY_STOPWORD',
|
||||||
@@ -152,7 +153,6 @@ class AddressPhraseDictionaries(object):
|
|||||||
|
|
||||||
if dictionary_name not in gazetteer_types:
|
if dictionary_name not in gazetteer_types:
|
||||||
raise InvalidAddressFileException(u'Invalid filename for file {}/{}. Must be one of {{{}}}'.format(language_dir, filename, ', '.join(sorted(gazetteer_types))))
|
raise InvalidAddressFileException(u'Invalid filename for file {}/{}. Must be one of {{{}}}'.format(language_dir, filename, ', '.join(sorted(gazetteer_types))))
|
||||||
|
|
||||||
self.language_dictionaries[language].append(dictionary_name)
|
self.language_dictionaries[language].append(dictionary_name)
|
||||||
|
|
||||||
for i, line in enumerate(open(os.path.join(language_dir, filename))):
|
for i, line in enumerate(open(os.path.join(language_dir, filename))):
|
||||||
|
|||||||
Reference in New Issue
Block a user