]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/tokenizer/base.py
add type annotations to special phrase importer
[nominatim.git] / nominatim / tokenizer / base.py
index afcb0864214eb6a2c7e2c6378b0dca0c7843c4e3..1c1ca9f7bcfca3d7fa407504ac0b0c9d728191a1 100644 (file)
@@ -9,7 +9,7 @@ Abstract class defintions for tokenizers. These base classes are here
 mainly for documentation purposes.
 """
 from abc import ABC, abstractmethod
-from typing import List, Tuple, Dict, Any, Optional
+from typing import List, Tuple, Dict, Any, Optional, Iterable
 from pathlib import Path
 
 from typing_extensions import Protocol
@@ -81,7 +81,8 @@ class AbstractAnalyzer(ABC):
 
 
     @abstractmethod
-    def update_special_phrases(self, phrases: List[Tuple[str, str, str, str]],
+    def update_special_phrases(self,
+                               phrases: Iterable[Tuple[str, str, str, str]],
                                should_replace: bool) -> None:
         """ Update the tokenizer's special phrase tokens from the given
             list of special phrases.