X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/dc7c11a9d1320965505ba18725466b0e9a648fde..122ecd46269d48a8b2aacba2474311c0400d2a9d:/src/nominatim_api/search/query_analyzer_factory.py?ds=sidebyside diff --git a/src/nominatim_api/search/query_analyzer_factory.py b/src/nominatim_api/search/query_analyzer_factory.py index e10d7a7a..ca25ccb5 100644 --- a/src/nominatim_api/search/query_analyzer_factory.py +++ b/src/nominatim_api/search/query_analyzer_factory.py @@ -18,6 +18,7 @@ from ..connection import SearchConnection if TYPE_CHECKING: from .query import Phrase, QueryStruct + class AbstractQueryAnalyzer(ABC): """ Class for analysing incoming queries. @@ -29,7 +30,6 @@ class AbstractQueryAnalyzer(ABC): """ Analyze the given phrases and return the tokenized query. """ - @abstractmethod def normalize_text(self, text: str) -> str: """ Bring the given text into a normalized form. That is the @@ -38,7 +38,6 @@ class AbstractQueryAnalyzer(ABC): """ - async def make_query_analyzer(conn: SearchConnection) -> AbstractQueryAnalyzer: """ Create a query analyzer for the tokenizer used by the database. """ @@ -49,6 +48,6 @@ async def make_query_analyzer(conn: SearchConnection) -> AbstractQueryAnalyzer: log().comment(f"No tokenizer named '{name}' available. Database not set up properly.") raise RuntimeError('Tokenizer not found') - module = importlib.import_module(f'nominatim_api.api.search.{name}_tokenizer') + module = importlib.import_module(f'nominatim_api.search.{name}_tokenizer') return cast(AbstractQueryAnalyzer, await module.create_query_analyzer(conn))