From a33a7db094eacec0d6e6eaa9419f992d9da85996 Mon Sep 17 00:00:00 2001 From: Anatoly Serdtcev Date: Mon, 14 Jan 2019 19:17:43 +0300 Subject: [PATCH] [geocoder] Fix street suffix ignoring in non street tokens --- geocoder/geocoder.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/geocoder/geocoder.cpp b/geocoder/geocoder.cpp index 9442cf99f8..7049ac7a7e 100644 --- a/geocoder/geocoder.cpp +++ b/geocoder/geocoder.cpp @@ -260,10 +260,11 @@ void Geocoder::Go(Context & ctx, Type type) const vector allTypes; for (size_t tokId = 0; tokId < ctx.GetNumTokens(); ++tokId) { - if (search::IsStreetSynonym(strings::MakeUniString(ctx.GetToken(tokId)))) + auto const t = ctx.GetTokenType(tokId); + + if (t == Type::Street && search::IsStreetSynonym(strings::MakeUniString(ctx.GetToken(tokId)))) continue; - auto const t = ctx.GetTokenType(tokId); certainty += GetWeight(t); if (t != Type::Count) allTypes.push_back(t);