]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/tokenizer/base.py
better error reporting when API script does not exist
[nominatim.git] / nominatim / tokenizer / base.py
index 53289c7816e9a32ca671c2205d35f19b217d5d68..94fac1fc4e1cdcab553af27f6fe1a94b21a9f95f 100644 (file)
@@ -194,15 +194,23 @@ class AbstractTokenizer(ABC):
         """ Check that the database is set up correctly and ready for being
             queried.
 
+            Arguments:
+              config: Read-only object with configuration options.
+
             Returns:
               If an issue was found, return an error message with the
               description of the issue as well as hints for the user on
-              how to resolve the issue.
+              how to resolve the issue. If everything is okay, return `None`.
+        """
+        pass
 
-            Arguments:
-              config: Read-only object with configuration options.
 
-              Return `None`, if no issue was found.
+    @abstractmethod
+    def update_statistics(self) -> None:
+        """ Recompute any tokenizer statistics necessary for efficient lookup.
+            This function is meant to be called from time to time by the user
+            to improve performance. However, the tokenizer must not depend on
+            it to be called in order to work.
         """
         pass