mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-12 13:54:07 +00:00
add type hints for sanitizers
This commit is contained in:
@@ -11,13 +11,18 @@ Arguments:
|
||||
delimiters: Define the set of characters to be used for
|
||||
splitting the list. (default: ',;')
|
||||
"""
|
||||
def create(config):
|
||||
from typing import Callable
|
||||
|
||||
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 = config.get_delimiter()
|
||||
|
||||
def _process(obj):
|
||||
def _process(obj: ProcessInfo) -> None:
|
||||
if not obj.names:
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user