diff options
author | Maxim Pimenov <m@maps.me> | 2016-05-27 19:40:55 +0300 |
---|---|---|
committer | Maxim Pimenov <m@maps.me> | 2016-05-31 14:54:46 +0300 |
commit | f672cb0b8227ddafcd6b271724dda3e05df9bfef (patch) | |
tree | 423ac795cf5da4a96136416827e943040f19a1b5 /search/ranking_info.hpp | |
parent | 59f40d7669598a229ffa4f6269e17234f9af9506 (diff) |
[search] Got rid of the v2 directory and namespace.
Diffstat (limited to 'search/ranking_info.hpp')
-rw-r--r-- | search/ranking_info.hpp | 49 |
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 |