From: AntoJvlt Date: Sat, 17 Apr 2021 17:24:13 +0000 (+0200) Subject: Fix occurence regex X-Git-Tag: v4.0.0~111^2~1 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/a95c74836323deac510e1d14412c19b790cee112?hp=--cc Fix occurence regex --- a95c74836323deac510e1d14412c19b790cee112 diff --git a/nominatim/tools/special_phrases.py b/nominatim/tools/special_phrases.py index 0c1258fe..af012ffb 100644 --- a/nominatim/tools/special_phrases.py +++ b/nominatim/tools/special_phrases.py @@ -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",