X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/d984100e23d28253b3659e7b628cde2c8b436cf8..86ad9efa8abb1fb478b3be5b6c469877aad05a51:/src/nominatim_api/search/geocoder.py diff --git a/src/nominatim_api/search/geocoder.py b/src/nominatim_api/search/geocoder.py index efe5b721..69455d77 100644 --- a/src/nominatim_api/search/geocoder.py +++ b/src/nominatim_api/search/geocoder.py @@ -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: