]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/tools/special_phrases/sp_wiki_loader.py
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / nominatim / tools / special_phrases / sp_wiki_loader.py
index 6093fa45c8fc3250217acb0db59d7885b901b2f2..ca4758ac49b3b1caad77e9e90bd74ff5259686b4 100644 (file)
@@ -37,6 +37,8 @@ class SPWikiLoader:
         self.occurence_pattern = re.compile(
             r'\| *([^\|]+) *\|\| *([^\|]+) *\|\| *([^\|]+) *\|\| *([^\|]+) *\|\| *([\-YN])'
         )
+        # Hack around a bug where building=yes was imported with quotes into the wiki
+        self.type_fix_pattern = re.compile(r'\"|"')
         self._load_languages()
 
 
@@ -52,7 +54,10 @@ class SPWikiLoader:
             matches = self.occurence_pattern.findall(loaded_xml)
 
             for match in matches:
-                yield SpecialPhrase(match[0], match[1], match[2], match[3])
+                yield SpecialPhrase(match[0],
+                                    match[1],
+                                    self.type_fix_pattern.sub('', match[2]),
+                                    match[3])
 
 
     def _load_languages(self):