co-maps/libs/search/pre_ranking_info.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
915 B
C++
Raw Permalink Normal View History

2025-11-22 13:58:55 +01:00
#include "search/pre_ranking_info.hpp"
#include <sstream>
namespace search
{
std::string DebugPrint(PreRankingInfo const & info)
{
std::ostringstream os;
os << std::boolalpha << "PreRankingInfo "
<< "{ m_distanceToPivot: " << info.m_distanceToPivot << ", m_tokenRanges [ ";
for (size_t i = 0; i < Model::TYPE_COUNT; ++i)
{
if (info.m_tokenRanges[i].Empty())
continue;
auto const type = static_cast<Model::Type>(i);
os << DebugPrint(type) << " : " << DebugPrint(info.m_tokenRanges[i]) << ", ";
}
os << " ]"
<< ", m_rank: " << static_cast<int>(info.m_rank) << ", m_popularity: " << static_cast<int>(info.m_popularity)
<< ", m_type: " << DebugPrint(info.m_type) << ", m_allTokensUsed: " << info.m_allTokensUsed
<< ", m_exactMatch: " << info.m_exactMatch << ", m_isCommonMatchOnly: " << info.m_isCommonMatchOnly << " }";
return os.str();
}
} // namespace search