Welcome to mirror list, hosted at ThFree Co, Russian Federation.

streets_matcher.hpp « search - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e81881592dfae42e0015698417b763e9084b745c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once

#include "search/cbv.hpp"
#include "search/geocoder_context.hpp"
#include "search/token_range.hpp"

#include "std/vector.hpp"

namespace search
{
class FeaturesFilter;
class QueryParams;

class StreetsMatcher
{
public:
  struct Prediction
  {
    inline size_t GetNumTokens() const { return m_tokenRange.Size(); }

    CBV m_features;
    TokenRange m_tokenRange;
    double m_prob = 0.0;
    uint64_t m_hash = 0;
  };

  static void Go(BaseContext const & ctx, FeaturesFilter const & filter, QueryParams const & params,
                 vector<Prediction> & predictions);

private:
  static void FindStreets(BaseContext const & ctx, FeaturesFilter const & filter,
                          QueryParams const & params, vector<Prediction> & prediction);
};
}  // namespace search