File size: 944 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 28 29 30 31 32 33 34 35 36 37 38 39 |
#include "BidirectionalReorderingState.h"
namespace Moses
{
///////////////////////////
//BidirectionalReorderingState
size_t BidirectionalReorderingState::hash() const
{
size_t ret = m_backward->hash();
boost::hash_combine(ret, m_forward->hash());
return ret;
}
bool BidirectionalReorderingState::operator==(const FFState& o) const
{
if (&o == this) return true;
BidirectionalReorderingState const &other
= static_cast<BidirectionalReorderingState const&>(o);
bool ret = (*m_backward == *other.m_backward) && (*m_forward == *other.m_forward);
return ret;
}
LRState*
BidirectionalReorderingState::
Expand(const TranslationOption& topt, const InputType& input,
ScoreComponentCollection* scores) const
{
LRState *newbwd = m_backward->Expand(topt,input, scores);
LRState *newfwd = m_forward->Expand(topt, input, scores);
return new BidirectionalReorderingState(m_configuration, newbwd, newfwd, m_offset);
}
}
|