mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-09 03:24:06 +00:00
remove postcodes from countries that don't have them
The postcodes will only be removed as a 'computed postcode' they are still searchable for the given object.
This commit is contained in:
@@ -44,6 +44,20 @@ class SanitizerConfig(UserDict):
|
||||
return values
|
||||
|
||||
|
||||
def get_bool(self, param, default=None):
|
||||
""" Extract a configuration parameter as a boolean.
|
||||
The parameter must be one of the yaml boolean values or an
|
||||
user error will be raised. If `default` is given, then the parameter
|
||||
may also be missing or empty.
|
||||
"""
|
||||
value = self.data.get(param, default)
|
||||
|
||||
if not isinstance(value, bool):
|
||||
raise UsageError(f"Parameter '{param}' must be a boolean value ('yes' or 'no'.")
|
||||
|
||||
return value
|
||||
|
||||
|
||||
def get_delimiter(self, default=',;'):
|
||||
""" Return the 'delimiter' parameter in the configuration as a
|
||||
compiled regular expression that can be used to split the names on the
|
||||
|
||||
@@ -48,8 +48,7 @@ class _AnalyzerByLanguage:
|
||||
self.deflangs = {}
|
||||
|
||||
if use_defaults in ('mono', 'all'):
|
||||
for ccode, prop in country_info.iterate():
|
||||
clangs = prop['languages']
|
||||
for ccode, clangs in country_info.iterate('languages'):
|
||||
if len(clangs) == 1 or use_defaults == 'all':
|
||||
if self.whitelist:
|
||||
self.deflangs[ccode] = [l for l in clangs if l in self.whitelist]
|
||||
|
||||
Reference in New Issue
Block a user