mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
39 lines
944 B
C++
39 lines
944 B
C++
#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);
|
|
}
|
|
|
|
}
|
|
|