From: AntoJvlt Date: Sat, 17 Apr 2021 17:24:13 +0000 (+0200) Subject: Fix occurence regex X-Git-Tag: v3.7.1~15 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/f7e4bfa980091a954a6429141ad97047e3dfe335 Fix occurence regex --- diff --git a/nominatim/tools/special_phrases.py b/nominatim/tools/special_phrases.py index 3bb240ab..d172498a 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",