X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/8171fe4571a57bf8e5b2a8f676989e973897e2e7..9ba20194706ad9e6e6488ca9afb3c67f22025de3:/nominatim/tokenizer/sanitizers/strip_brace_terms.py diff --git a/nominatim/tokenizer/sanitizers/strip_brace_terms.py b/nominatim/tokenizer/sanitizers/strip_brace_terms.py index 4423d305..ec91bac9 100644 --- a/nominatim/tokenizer/sanitizers/strip_brace_terms.py +++ b/nominatim/tokenizer/sanitizers/strip_brace_terms.py @@ -10,13 +10,13 @@ def create(_): def _process(obj): """ Add variants for names that have a bracket extension. """ - new_names = [] if obj.names: + new_names = [] for name in (n for n in obj.names if '(' in n.name): new_name = name.name.split('(')[0].strip() if new_name: new_names.append(name.clone(name=new_name)) - obj.names.extend(new_names) + obj.names.extend(new_names) return _process