X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/4a5786334b95e1efc4d2cf27c8d31e73f850771a..7b0e0dfd883b268b58a721e2967303fa368e563f:/nominatim/api/search/token_assignment.py?ds=inline diff --git a/nominatim/api/search/token_assignment.py b/nominatim/api/search/token_assignment.py index 0ae2cd43..3f0e737b 100644 --- a/nominatim/api/search/token_assignment.py +++ b/nominatim/api/search/token_assignment.py @@ -253,6 +253,8 @@ class _TokenSequence: priors = sum(1 for t in self.seq[hnrpos+1:] if t.ttype == qmod.TokenType.PARTIAL) if not self._adapt_penalty_from_priors(priors, 1): return False + if any(t.ttype == qmod.TokenType.CATEGORY for t in self.seq): + self.penalty += 1.0 return True