| 641 | } |
| 642 | |
| 643 | void Geocoder::InitBaseContext(BaseContext & ctx) |
| 644 | { |
| 645 | Retrieval retrieval(*m_context, m_cancellable); |
| 646 | |
| 647 | size_t const numTokens = m_params.GetNumTokens(); |
| 648 | ctx.m_tokens.assign(numTokens, BaseContext::TOKEN_TYPE_COUNT); |
| 649 | ctx.m_features.resize(numTokens); |
| 650 | for (size_t i = 0; i < numTokens; ++i) |
| 651 | { |
| 652 | if (m_params.IsCategorialRequest()) |
| 653 | { |
| 654 | // Implementation-wise, the simplest way to match a feature by |
| 655 | // its category bypassing the matching by name is by using a CategoriesCache. |
| 656 | CategoriesCache cache(m_params.m_preferredTypes, m_cancellable); |
| 657 | ctx.m_features[i] = Retrieval::ExtendedFeatures(cache.Get(*m_context)); |
| 658 | } |
| 659 | else if (m_params.IsPrefixToken(i)) |
| 660 | { |
| 661 | ctx.m_features[i] = retrieval.RetrieveAddressFeatures(m_prefixTokenRequest); |
| 662 | } |
| 663 | else |
| 664 | { |
| 665 | ctx.m_features[i] = retrieval.RetrieveAddressFeatures(m_tokenRequests[i]); |
| 666 | } |
| 667 | } |
| 668 | } |
| 669 | |
| 670 | void Geocoder::InitLayer(Model::Type type, TokenRange const & tokenRange, FeaturesLayer & layer) |
| 671 | { |
nothing calls this directly
no test coverage detected