X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/6e89310a9285f1ad15d8002bf68f578eada367a0..ee8915f2b65f906e9acdbf5c899437e457943e1f:/src/nominatim_db/tokenizer/token_analysis/config_variants.py?ds=sidebyside diff --git a/src/nominatim_db/tokenizer/token_analysis/config_variants.py b/src/nominatim_db/tokenizer/token_analysis/config_variants.py index b455a8a5..7e181479 100644 --- a/src/nominatim_db/tokenizer/token_analysis/config_variants.py +++ b/src/nominatim_db/tokenizer/token_analysis/config_variants.py @@ -12,8 +12,9 @@ from collections import defaultdict import itertools import re -from nominatim_core.config import flatten_config_list -from nominatim_core.errors import UsageError +from ...config import flatten_config_list +from ...errors import UsageError + class ICUVariant(NamedTuple): """ A single replacement rule for variant creation. @@ -64,7 +65,6 @@ class _VariantMaker: def __init__(self, normalizer: Any) -> None: self.norm = normalizer - def compute(self, rule: Any) -> Iterator[ICUVariant]: """ Generator for all ICUVariant tuples from a single variant rule. """ @@ -88,7 +88,6 @@ class _VariantMaker: for froms, tos in _create_variants(*src, repl, decompose): yield ICUVariant(froms, tos) - def _parse_variant_word(self, name: str) -> Optional[Tuple[str, str, str]]: name = name.strip() match = re.fullmatch(r'([~^]?)([^~$^]*)([~$]?)', name)