]> git.openstreetmap.org Git - nominatim.git/commitdiff
Fix occurence regex
authorAntoJvlt <antonin.jolivat@gmail.com>
Sat, 17 Apr 2021 17:24:13 +0000 (19:24 +0200)
committerAntoJvlt <antonin.jolivat@gmail.com>
Sat, 17 Apr 2021 17:24:13 +0000 (19:24 +0200)
nominatim/tools/special_phrases.py

index 0c1258fefb0b9cece4c4e7ca88869b39fd97ab0e..af012ffbf9fac9709bfcf27749d1c2cfdf481818 100644 (file)
@@ -27,7 +27,7 @@ class SpecialPhrasesImporter():
         self.black_list, self.white_list = self._load_white_and_black_lists()
         #Compile the regex here to increase performances.
         self.occurence_pattern = re.compile(
-            r'\| ([^\|]+) \|\| ([^\|]+) \|\| ([^\|]+) \|\| ([^\|]+) \|\| ([\-YN])'
+            r'\| *([^\|]+) *\|\| *([^\|]+) *\|\| *([^\|]+) *\|\| *([^\|]+) *\|\| *([\-YN])'
         )
         self.sanity_check_pattern = re.compile(r'^\w+$')
         self.transliterator = Transliterator.createFromRules("special-phrases normalizer",