Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/moses/PP
diff options
context:
space:
mode:
authorMatthias Huck <huck@i6.informatik.rwth-aachen.de>2014-12-03 23:04:26 +0300
committerMatthias Huck <huck@i6.informatik.rwth-aachen.de>2014-12-03 23:04:26 +0300
commit24a8a6a51104c8518fcb8d252f83ff580986c2db (patch)
tree1fc5f912f7623dda8d1a1f08fb0e9acfff32cba8 /moses/PP
parent5bbd30ec12e4bcb88e29246e4fce71cc33528d44 (diff)
PhraseOrientationFeature
Diffstat (limited to 'moses/PP')
-rw-r--r--moses/PP/OrientationPhraseProperty.cpp6
-rw-r--r--moses/PP/OrientationPhraseProperty.h16
2 files changed, 15 insertions, 7 deletions
diff --git a/moses/PP/OrientationPhraseProperty.cpp b/moses/PP/OrientationPhraseProperty.cpp
index 653a1bf3b..1722a5383 100644
--- a/moses/PP/OrientationPhraseProperty.cpp
+++ b/moses/PP/OrientationPhraseProperty.cpp
@@ -8,13 +8,13 @@ namespace Moses
void OrientationPhraseProperty::ProcessValue(const std::string &value)
{
// bidirectional MSLR phrase orientation with 2x4 orientation classes:
- // mono swap dright dleft
+ // mono swap dleft dright
std::istringstream tokenizer(value);
try {
- if (! (tokenizer >> m_l2rMonoProbability >> m_l2rSwapProbability >> m_l2rDrightProbability >> m_l2rDleftProbability
- >> m_r2lMonoProbability >> m_r2lSwapProbability >> m_r2lDrightProbability >> m_r2lDleftProbability)) {
+ if (! (tokenizer >> m_l2rMonoProbability >> m_l2rSwapProbability >> m_l2rDleftProbability >> m_l2rDrightProbability
+ >> m_r2lMonoProbability >> m_r2lSwapProbability >> m_r2lDleftProbability >> m_r2lDrightProbability)) {
UTIL_THROW2("OrientationPhraseProperty: Not able to read value. Flawed property?");
}
} catch (const std::exception &e) {
diff --git a/moses/PP/OrientationPhraseProperty.h b/moses/PP/OrientationPhraseProperty.h
index 32c6ff208..f6344062c 100644
--- a/moses/PP/OrientationPhraseProperty.h
+++ b/moses/PP/OrientationPhraseProperty.h
@@ -24,12 +24,16 @@ public:
return m_l2rSwapProbability;
};
+ double GetLeftToRightProbabilityDleft() const {
+ return m_l2rDleftProbability;
+ };
+
double GetLeftToRightProbabilityDright() const {
return m_l2rDrightProbability;
};
- double GetLeftToRightProbabilityDleft() const {
- return m_l2rDleftProbability;
+ double GetLeftToRightProbabilityDiscontinuous() const {
+ return m_l2rDleftProbability + m_l2rDrightProbability;
};
@@ -41,12 +45,16 @@ public:
return m_r2lSwapProbability;
};
+ double GetRightToLeftProbabilityDleft() const {
+ return m_r2lDleftProbability;
+ };
+
double GetRightToLeftProbabilityDright() const {
return m_r2lDrightProbability;
};
- double GetRightToLeftProbabilityDleft() const {
- return m_r2lDleftProbability;
+ double GetRightToLeftProbabilityDiscontinuous() const {
+ return m_r2lDleftProbability + m_r2lDrightProbability;
};