]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/tools/special_phrases/sp_importer.py
fix uses of config.get_path() to expect None
[nominatim.git] / nominatim / tools / special_phrases / sp_importer.py
index 8137142bd27bf2df5cd4cf84a82a8c3cdd8d3662..805f8937875beb4dda7d5063b33d6d1c39605d6c 100644 (file)
@@ -33,7 +33,7 @@ class SPImporter():
 
         Take a sp loader which load the phrases from an external source.
     """
-    def __init__(self, config, db_connection, sp_loader) -> None:
+    def __init__(self, config, db_connection, sp_loader):
         self.config = config
         self.db_connection = db_connection
         self.sp_loader = sp_loader
@@ -62,11 +62,10 @@ class SPImporter():
         # Store pairs of class/type for further processing
         class_type_pairs = set()
 
-        for loaded_phrases in self.sp_loader:
-            for phrase in loaded_phrases:
-                result = self._process_phrase(phrase)
-                if result:
-                    class_type_pairs.add(result)
+        for phrase in self.sp_loader.generate_phrases():
+            result = self._process_phrase(phrase)
+            if result:
+                class_type_pairs.add(result)
 
         self._create_place_classtype_table_and_indexes(class_type_pairs)
         if should_replace: