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: f1eb3e17733511c9f80e9468a02e04565f2130b0 (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 <string>

class FeatureBuilder1;

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, FeatureBuilder1 const & fb);
}  // namespace booking_scoring
}  // namespace generator