X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/4774e45218bcfcef3390f820ad48b1b67b2bd0c4..2dafc4cf4fc46ea4be293a458d565fbff645ac28:/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 b2a2045f..7d0667b4 100644 --- a/nominatim/tokenizer/sanitizers/split_name_list.py +++ b/nominatim/tokenizer/sanitizers/split_name_list.py @@ -11,16 +11,18 @@ Arguments: delimiters: Define the set of characters to be used for splitting the list. (default: ',;') """ -from nominatim.errors import UsageError -from nominatim.tokenizer.sanitizers.helpers import create_split_regex +from typing import Callable -def create(func): +from nominatim.tokenizer.sanitizers.base import ProcessInfo +from nominatim.tokenizer.sanitizers.config import SanitizerConfig + +def create(config: SanitizerConfig) -> Callable[[ProcessInfo], None]: """ 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): + def _process(obj: ProcessInfo) -> None: if not obj.names: return