1 # SPDX-License-Identifier: GPL-3.0-or-later
3 # This file is part of Nominatim. (https://nominatim.org)
5 # Copyright (C) 2024 by the Nominatim developer community.
6 # For a full list of authors see the git log.
8 Normalize query test using an ICU transliterator.
10 from typing import cast
12 from .config import QueryConfig
13 from .base import QueryProcessingFunc
14 from ..search.query import Phrase
17 def create(config: QueryConfig) -> QueryProcessingFunc:
18 normalizer = config.get('_normalizer')
23 return lambda phrases: list(
24 filter(lambda p: p.text,
25 (Phrase(p.ptype, cast(str, normalizer.transliterate(p.text)))