X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/19d4e047f6d3c525f64978e0965d75556bfc5b1e..c3788d765ed4e7ddf00794085af757714bc102cf:/nominatim/tokenizer/sanitizers/split_name_list.py?ds=sidebyside diff --git a/nominatim/tokenizer/sanitizers/split_name_list.py b/nominatim/tokenizer/sanitizers/split_name_list.py index f1514203..3250c668 100644 --- a/nominatim/tokenizer/sanitizers/split_name_list.py +++ b/nominatim/tokenizer/sanitizers/split_name_list.py @@ -1,5 +1,15 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# This file is part of Nominatim. (https://nominatim.org) +# +# Copyright (C) 2022 by the Nominatim developer community. +# For a full list of authors see the git log. """ -Name processor that splits name values with multiple values into their components. +Sanitizer that splits lists of names into their components. + +Arguments: + delimiters: Define the set of characters to be used for + splitting the list. (default: `,;`) """ import re @@ -7,9 +17,7 @@ from nominatim.errors import UsageError def create(func): """ Create a name processing function that splits name values with - multiple values into their components. The optional parameter - 'delimiters' can be used to define the characters that should be used - for splitting. The default is ',;'. + multiple values into their components. """ delimiter_set = set(func.get('delimiters', ',;')) if not delimiter_set: @@ -24,7 +32,6 @@ def create(func): new_names = [] for name in obj.names: split_names = regexp.split(name.name) - print(split_names) if len(split_names) == 1: new_names.append(name) else: