| 983 | } |
| 984 | |
| 985 | void Ranker::MatchForSuggestions(strings::UniString const & token, int8_t locale, string const & prologue) |
| 986 | { |
| 987 | for (auto const & suggest : m_suggests) |
| 988 | { |
| 989 | strings::UniString const & s = suggest.m_name; |
| 990 | if (suggest.m_prefixLength <= token.size() && token != s // do not push suggestion if it already equals to token |
| 991 | && suggest.m_locale == locale // push suggestions only for needed language |
| 992 | && strings::StartsWith(s, token)) |
| 993 | { |
| 994 | string const utf8Str = strings::ToUtf8(s); |
| 995 | Result r(utf8Str, prologue + utf8Str + " "); |
| 996 | HighlightResult(m_params.m_query.m_tokens, m_params.m_query.m_prefix, r); |
| 997 | m_emitter.AddResult(std::move(r)); |
| 998 | } |
| 999 | } |
| 1000 | } |
| 1001 | |
| 1002 | void Ranker::ProcessSuggestions(vector<RankerResult> const & vec) const |
| 1003 | { |
nothing calls this directly
no test coverage detected