From bdded69ab636ab8e3bb46322ebbe4d2f9ec41614 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Tue, 2 Apr 2024 16:30:50 +0200 Subject: [PATCH] housenumber position should hint on direction rather than increasing penalty. --- nominatim/api/search/token_assignment.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nominatim/api/search/token_assignment.py b/nominatim/api/search/token_assignment.py index ca907b79..95eb7f70 100644 --- a/nominatim/api/search/token_assignment.py +++ b/nominatim/api/search/token_assignment.py @@ -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 -- 2.45.1