X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/cce0e5ea38fe3466e157651e789554d99fbdc8fe..674185a0651a4f6719e7fe71e00cca147783a1f4:/nominatim/tools/special_phrases/sp_wiki_loader.py diff --git a/nominatim/tools/special_phrases/sp_wiki_loader.py b/nominatim/tools/special_phrases/sp_wiki_loader.py index 6093fa45..ca4758ac 100644 --- a/nominatim/tools/special_phrases/sp_wiki_loader.py +++ b/nominatim/tools/special_phrases/sp_wiki_loader.py @@ -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):