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/FF
diff options
context:
space:
mode:
Diffstat (limited to 'moses/FF')
-rw-r--r--moses/FF/RuleScope.cpp14
-rw-r--r--moses/FF/RuleScope.h1
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;
};
}