blob: 4c7f4291fe3107daeacedd76448dec0c78ccc4a5 (
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
|
#include "search/region.hpp"
#include "base/assert.hpp"
namespace search
{
bool Region::operator<(Region const & rhs) const
{
return (m_matchedTokens.size() < rhs.m_matchedTokens.size());
}
bool Region::IsValid() const
{
if (m_ids.empty())
return false;
ASSERT(!m_matchedTokens.empty(), ());
ASSERT(!m_enName.empty(), ());
return true;
}
void Region::Swap(Region & rhs)
{
m_ids.swap(rhs.m_ids);
m_matchedTokens.swap(rhs.m_matchedTokens);
m_enName.swap(rhs.m_enName);
}
string DebugPrint(Region const & r)
{
string res("Region: ");
res += "Name English: " + r.m_enName;
res += "; Matched: " + ::DebugPrint(r.m_matchedTokens.size());
return res;
}
} // namespace search
|