mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-11 21:34:06 +00:00
in-word penalty for final address token
This commit is contained in:
@@ -342,7 +342,10 @@ class SearchBuilder:
|
|||||||
heapq.heappush(todo, (-tlist.end, tlist.end,
|
heapq.heappush(todo, (-tlist.end, tlist.end,
|
||||||
rank.with_token(t, chgpenalty)))
|
rank.with_token(t, chgpenalty)))
|
||||||
elif tlist.end == trange.end:
|
elif tlist.end == trange.end:
|
||||||
ranks.extend(rank.with_token(t, 0.0) for t in tlist.tokens)
|
chgpenalty = self.query.get_in_word_penalty(
|
||||||
|
qmod.TokenRange(pos, tlist.end))
|
||||||
|
ranks.extend(rank.with_token(t, chgpenalty)
|
||||||
|
for t in tlist.tokens)
|
||||||
|
|
||||||
if len(ranks) >= 10:
|
if len(ranks) >= 10:
|
||||||
# Too many variants, bail out and only add
|
# Too many variants, bail out and only add
|
||||||
|
|||||||
Reference in New Issue
Block a user