sanitizer: move helpers into a configuration class

This commit is contained in:
Sarah Hoffmann
2022-02-07 10:48:00 +01:00
parent a79a3210e6
commit 610f2cc254
10 changed files with 124 additions and 80 deletions

View File

@@ -11,13 +11,11 @@ Arguments:
delimiters: Define the set of characters to be used for
splitting the list. (default: ',;')
"""
from nominatim.tokenizer.sanitizers.helpers import create_split_regex
def create(func):
def create(config):
""" Create a name processing function that splits name values with
multiple values into their components.
"""
regexp = create_split_regex(func)
regexp = config.get_delimiter()
def _process(obj):
if not obj.names: