]> git.openstreetmap.org Git - nominatim.git/blobdiff - src/nominatim_db/tokenizer/token_analysis/base.py
release 5.1.0.post5
[nominatim.git] / src / nominatim_db / tokenizer / token_analysis / base.py
index 9435edb3b562442a6c5369888390453137bdd828..186f1d3ebc1113575a41929b605cfc32d8f5ecb2 100644 (file)
@@ -7,11 +7,12 @@
 """
 Common data types and protocols for analysers.
 """
 """
 Common data types and protocols for analysers.
 """
-from typing import Mapping, List, Any
+from typing import Mapping, List, Any, Union, Tuple
 
 from ...typing import Protocol
 from ...data.place_name import PlaceName
 
 
 from ...typing import Protocol
 from ...data.place_name import PlaceName
 
+
 class Analyzer(Protocol):
     """ The `create()` function of an analysis module needs to return an
         object that implements the following functions.
 class Analyzer(Protocol):
     """ The `create()` function of an analysis module needs to return an
         object that implements the following functions.
@@ -32,7 +33,7 @@ class Analyzer(Protocol):
                     for example because the character set in use does not match.
         """
 
                     for example because the character set in use does not match.
         """
 
-    def compute_variants(self, canonical_id: str) -> List[str]:
+    def compute_variants(self, canonical_id: str) -> Union[List[str], Tuple[List[str], List[str]]]:
         """ Compute the transliterated spelling variants for the given
             canonical ID.
 
         """ Compute the transliterated spelling variants for the given
             canonical ID.