File size: 436 Bytes
158b61b |
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 |
#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
|