blob: a64cbee44e0ab69f2370615dd983fecb9020269e (
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
|
#pragma once
#include "moses/FF/FFState.h"
#include "SVertex.h"
namespace Moses
{
namespace Syntax
{
class SVertexRecombinationHasher
{
public:
std::size_t operator()(const SVertex *v) const {
std::size_t seed = 0;
for (std::vector<FFState*>::const_iterator p = v->states.begin();
p != v->states.end(); ++p) {
boost::hash_combine(seed, (*p)->hash());
}
return seed;
}
};
} // Syntax
} // Moses
|