]> git.openstreetmap.org Git - nominatim.git/commitdiff
housenumber position should hint on direction
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 2 Apr 2024 14:30:50 +0000 (16:30 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 2 Apr 2024 14:30:50 +0000 (16:30 +0200)
rather than increasing penalty.

nominatim/api/search/token_assignment.py

index ca907b797dfe53b24e48d1602cc19ca97ff0fc2c..95eb7f7059cd4c3339cbb75c903be6df536cd41d 100644 (file)
@@ -225,13 +225,14 @@ class _TokenSequence:
 
 
     def _adapt_penalty_from_priors(self, priors: int, new_dir: int) -> bool:
-        if priors == 2:
-            self.penalty += 1.0
-        elif priors > 2:
+        if priors >= 2:
             if self.direction == 0:
                 self.direction = new_dir
             else:
-                return False
+                if priors == 2:
+                    self.penalty += 0.8
+                else:
+                    return False
 
         return True