File size: 1,144 Bytes
fd49381 |
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 |
#pragma once
#include "LRState.h"
#include "ReorderingStack.h"
namespace Moses
{
//! State for a hierarchical reordering model (see Galley and Manning, A
//! Simple and Effective Hierarchical Phrase Reordering Model, EMNLP 2008)
//! backward state (conditioned on the previous phrase)
class HReorderingBackwardState : public LRState
{
private:
ReorderingStack m_reoStack;
public:
HReorderingBackwardState(const LRModel &config, size_t offset);
HReorderingBackwardState(const HReorderingBackwardState *prev,
const TranslationOption &topt,
ReorderingStack reoStack);
virtual size_t hash() const;
virtual bool operator==(const FFState& other) const;
virtual LRState* Expand(const TranslationOption& hypo, const InputType& input,
ScoreComponentCollection* scores) const;
private:
ReorderingType GetOrientationTypeMSD(int reoDistance) const;
ReorderingType GetOrientationTypeMSLR(int reoDistance) const;
ReorderingType GetOrientationTypeMonotonic(int reoDistance) const;
ReorderingType GetOrientationTypeLeftRight(int reoDistance) const;
};
}
|