]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/api/search/token_assignment.py
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / nominatim / api / search / token_assignment.py
index 0ae2cd4306c9e4ca1c78cbd9acd9c0363aa7b9c8..3f0e737b004d623f5eef758a40b1a59e1d495806 100644 (file)
@@ -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