Merge pull request #3293 from lonvia/rematch-against-country-code

Add country code to words to be rematched
This commit is contained in:
Sarah Hoffmann 2024-01-08 18:48:32 +01:00 committed by GitHub
commit b969c5a62f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -141,7 +141,8 @@ class ForwardGeocoder:
or (result.importance is not None and result.importance < 0):
continue
distance = 0.0
norm = self.query_analyzer.normalize_text(result.display_name)
norm = self.query_analyzer.normalize_text(' '.join((result.display_name,
result.country_code or '')))
words = set((w for w in norm.split(' ') if w))
if not words:
continue