diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2015-03-17 13:25:34 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2015-03-17 13:25:34 +0300 |
commit | 25feb7e47b0cf213d7b01b494170559d27f5adca (patch) | |
tree | e5b48a6c9ca3c8bb9e8f4df040bdd7bcf2c036cb /moses | |
parent | e1a5c1e1403ecf4f761540873f0328a51fd4c0db (diff) |
option to change the estimated score only, not actuall score
Diffstat (limited to 'moses')
-rw-r--r-- | moses/FF/RuleScope.cpp | 14 | ||||
-rw-r--r-- | moses/FF/RuleScope.h | 1 |
2 files changed, 13 insertions, 2 deletions
diff --git a/moses/FF/RuleScope.cpp b/moses/FF/RuleScope.cpp index 5f38a59ae..3cfc19e7c 100644 --- a/moses/FF/RuleScope.cpp +++ b/moses/FF/RuleScope.cpp @@ -7,6 +7,7 @@ namespace Moses RuleScope::RuleScope(const std::string &line) :StatelessFeatureFunction(1, line) ,m_sourceSyntax(true) + ,m_futureCostOnly(false) { } @@ -45,14 +46,23 @@ void RuleScope::EvaluateInIsolation(const Phrase &source score += count; } - scoreBreakdown.PlusEquals(this, score); + if (m_futureCostOnly) { + estimatedFutureScore.PlusEquals(this, score); + } + else { + scoreBreakdown.PlusEquals(this, score); + } } void RuleScope::SetParameter(const std::string& key, const std::string& value) { if (key == "source-syntax") { m_sourceSyntax = Scan<bool>(value); - } else { + } + else if ("future-cost-only") { + m_futureCostOnly = Scan<bool>(value); + } + else { StatelessFeatureFunction::SetParameter(key, value); } } diff --git a/moses/FF/RuleScope.h b/moses/FF/RuleScope.h index 8bf7b7670..75148d0de 100644 --- a/moses/FF/RuleScope.h +++ b/moses/FF/RuleScope.h @@ -45,6 +45,7 @@ public: protected: bool m_sourceSyntax; + bool m_futureCostOnly; }; } |