X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/7d911f9ffbdf63b2b2a45c3a3ee7063d006a5779..df15f13c628a3e15dee4bcad44e97b2cacb40b9f:/nominatim/api/search/query_analyzer_factory.py?ds=sidebyside diff --git a/nominatim/api/search/query_analyzer_factory.py b/nominatim/api/search/query_analyzer_factory.py index 35649d0f..3666b7fc 100644 --- a/nominatim/api/search/query_analyzer_factory.py +++ b/nominatim/api/search/query_analyzer_factory.py @@ -19,7 +19,7 @@ if TYPE_CHECKING: from nominatim.api.search.query import Phrase, QueryStruct class AbstractQueryAnalyzer(ABC): - """ Class for analysing incomming queries. + """ Class for analysing incoming queries. Query analyzers are tied to the tokenizer used on import. """ @@ -30,6 +30,15 @@ class AbstractQueryAnalyzer(ABC): """ + @abstractmethod + def normalize_text(self, text: str) -> str: + """ Bring the given text into a normalized form. That is the + standardized form search will work with. All information removed + at this stage is inevitably lost. + """ + + + async def make_query_analyzer(conn: SearchConnection) -> AbstractQueryAnalyzer: """ Create a query analyzer for the tokenizer used by the database. """