X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/6e89310a9285f1ad15d8002bf68f578eada367a0..1f0796778754d8df0dfab9dd01302e26a397f064:/src/nominatim_db/tokenizer/factory.py diff --git a/src/nominatim_db/tokenizer/factory.py b/src/nominatim_db/tokenizer/factory.py index d43929f0..70b2b0be 100644 --- a/src/nominatim_db/tokenizer/factory.py +++ b/src/nominatim_db/tokenizer/factory.py @@ -15,23 +15,21 @@ be used consistently when querying and updating the database. This module provides the functions to create and configure a new tokenizer as well as instantiating the appropriate tokenizer for updating an existing database. - -A tokenizer usually also includes PHP code for querying. The appropriate PHP -normalizer module is installed, when the tokenizer is created. """ from typing import Optional import logging import importlib from pathlib import Path -from nominatim_core.errors import UsageError -from nominatim_core.db import properties -from nominatim_core.db.connection import connect -from nominatim_core.config import Configuration +from ..errors import UsageError +from ..db import properties +from ..db.connection import connect +from ..config import Configuration from ..tokenizer.base import AbstractTokenizer, TokenizerModule LOG = logging.getLogger() + def _import_tokenizer(name: str) -> TokenizerModule: """ Load the tokenizer.py module from project directory. """ @@ -41,7 +39,7 @@ def _import_tokenizer(name: str) -> TokenizerModule: "Check the setting of NOMINATIM_TOKENIZER.", name) raise UsageError('Tokenizer not found') - return importlib.import_module('nominatim.tokenizer.' + name + '_tokenizer') + return importlib.import_module('nominatim_db.tokenizer.' + name + '_tokenizer') def create_tokenizer(config: Configuration, init_db: bool = True,