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

sponsored_scoring.hpp « generator - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 74f99185e1bd67ec69c00b10d56265a1cabaa1ed (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
35
36
37
#pragma once

#include <string>

namespace feature
{
class FeatureBuilder;
}  // namespace feature

namespace generator
{
namespace impl
{
double GetLinearNormDistanceScore(double distance, double maxDistance);
double GetNameSimilarityScore(std::string const & booking_name, std::string const & osm_name);
}  // namespace impl

namespace sponsored_scoring
{
/// Represents a match scoring statystics of a sponsored object agains osm object.
template <typename SponsoredObject>
struct MatchStats
{
  /// Returns some score based on geven fields and classificator tuning.
  double GetMatchingScore() const;
  /// Returns true if GetMatchingScore is greater then some theshold.
  bool IsMatched() const;

  double m_linearNormDistanceScore{};
  double m_nameSimilarityScore{};
};

/// Matches a given sponsored object against a given OSM object.
template <typename SponsoredObject>
MatchStats<SponsoredObject> Match(SponsoredObject const & o, feature::FeatureBuilder const & fb);
}  // namespace booking_scoring
}  // namespace generator