]> git.openstreetmap.org Git - nominatim.git/blobdiff - src/nominatim_api/search/geocoder.py
keep break indicators [:-] during normalisation
[nominatim.git] / src / nominatim_api / search / geocoder.py
index efe5b7216853ba64c4983cd31801999c750c1512..69455d77a0d3c14aa79d168fd053e045e80ad39a 100644 (file)
@@ -133,7 +133,7 @@ class ForwardGeocoder:
         """
         assert self.query_analyzer is not None
         qwords = [word for phrase in query.source
-                  for word in re.split('[, ]+', phrase.text) if word]
+                  for word in re.split('[-,: ]+', phrase.text) if word]
         if not qwords:
             return
 
@@ -146,7 +146,7 @@ class ForwardGeocoder:
             distance = 0.0
             norm = self.query_analyzer.normalize_text(' '.join((result.display_name,
                                                                 result.country_code or '')))
-            words = set((w for w in norm.split(' ') if w))
+            words = set((w for w in re.split('[-,: ]+', norm) if w))
             if not words:
                 continue
             for qword in qwords: