2014-08-08 00:43:09 +04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "moses/PP/PhraseProperty.h"
|
|
|
|
#include "util/exception.hh"
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace Moses
|
|
|
|
{
|
|
|
|
|
|
|
|
class OrientationPhraseProperty : public PhraseProperty
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
OrientationPhraseProperty() {};
|
|
|
|
|
|
|
|
virtual void ProcessValue(const std::string &value);
|
|
|
|
|
|
|
|
|
|
|
|
double GetLeftToRightProbabilityMono() const {
|
|
|
|
return m_l2rMonoProbability;
|
|
|
|
};
|
|
|
|
|
|
|
|
double GetLeftToRightProbabilitySwap() const {
|
|
|
|
return m_l2rSwapProbability;
|
|
|
|
};
|
|
|
|
|
2014-12-03 23:04:26 +03:00
|
|
|
double GetLeftToRightProbabilityDleft() const {
|
|
|
|
return m_l2rDleftProbability;
|
|
|
|
};
|
|
|
|
|
2014-08-08 00:43:09 +04:00
|
|
|
double GetLeftToRightProbabilityDright() const {
|
|
|
|
return m_l2rDrightProbability;
|
|
|
|
};
|
|
|
|
|
2014-12-03 23:04:26 +03:00
|
|
|
double GetLeftToRightProbabilityDiscontinuous() const {
|
|
|
|
return m_l2rDleftProbability + m_l2rDrightProbability;
|
2014-08-08 00:43:09 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
double GetRightToLeftProbabilityMono() const {
|
|
|
|
return m_r2lMonoProbability;
|
|
|
|
};
|
|
|
|
|
|
|
|
double GetRightToLeftProbabilitySwap() const {
|
|
|
|
return m_r2lSwapProbability;
|
|
|
|
};
|
|
|
|
|
2014-12-03 23:04:26 +03:00
|
|
|
double GetRightToLeftProbabilityDleft() const {
|
|
|
|
return m_r2lDleftProbability;
|
|
|
|
};
|
|
|
|
|
2014-08-08 00:43:09 +04:00
|
|
|
double GetRightToLeftProbabilityDright() const {
|
|
|
|
return m_r2lDrightProbability;
|
|
|
|
};
|
|
|
|
|
2014-12-03 23:04:26 +03:00
|
|
|
double GetRightToLeftProbabilityDiscontinuous() const {
|
|
|
|
return m_r2lDleftProbability + m_r2lDrightProbability;
|
2014-08-08 00:43:09 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-01-14 14:07:42 +03:00
|
|
|
virtual const std::string *GetValueString() const {
|
2014-08-08 00:43:09 +04:00
|
|
|
UTIL_THROW2("OrientationPhraseProperty: value string not available in this phrase property");
|
2015-01-14 14:07:42 +03:00
|
|
|
return NULL;
|
2014-08-08 00:43:09 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
float m_l2rMonoProbability, m_l2rSwapProbability, m_l2rDrightProbability, m_l2rDleftProbability,
|
|
|
|
m_r2lMonoProbability, m_r2lSwapProbability, m_r2lDrightProbability, m_r2lDleftProbability;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Moses
|
|
|
|
|