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

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'search/ranking_info.hpp')
-rw-r--r--search/ranking_info.hpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/search/ranking_info.hpp b/search/ranking_info.hpp
new file mode 100644
index 0000000000..d5ee955af4
--- /dev/null
+++ b/search/ranking_info.hpp
@@ -0,0 +1,49 @@
+#pragma once
+
+#include "search/pre_ranking_info.hpp"
+#include "search/ranking_utils.hpp"
+#include "search/search_model.hpp"
+
+#include "std/iostream.hpp"
+
+class FeatureType;
+
+namespace search
+{
+struct RankingInfo
+{
+ static double const kMaxDistMeters;
+
+ // Distance from the feature to the pivot point.
+ double m_distanceToPivot = kMaxDistMeters;
+
+ // Rank of the feature.
+ uint8_t m_rank = 0;
+
+ // Score for the feature's name.
+ NameScore m_nameScore = NAME_SCORE_ZERO;
+
+ // Search type for the feature.
+ SearchModel::SearchType m_searchType = SearchModel::SEARCH_TYPE_COUNT;
+
+ // True if all of the tokens that the feature was matched by
+ // correspond to this feature's categories.
+ bool m_pureCats = false;
+
+ // True if none of the tokens that the feature was matched by
+ // corresponds to this feature's categories although all of the
+ // tokens are categorial ones.
+ bool m_falseCats = false;
+
+ static void PrintCSVHeader(ostream & os);
+
+ void ToCSV(ostream & os) const;
+
+ // Returns rank calculated by a linear model. Large values
+ // correspond to important features.
+ double GetLinearModelRank() const;
+};
+
+string DebugPrint(RankingInfo const & info);
+
+} // namespace search