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
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2015-03-17 13:25:34 +0300
committerHieu Hoang <hieuhoang@gmail.com>2015-03-17 13:25:34 +0300
commit25feb7e47b0cf213d7b01b494170559d27f5adca (patch)
treee5b48a6c9ca3c8bb9e8f4df040bdd7bcf2c036cb
parente1a5c1e1403ecf4f761540873f0328a51fd4c0db (diff)
option to change the estimated score only, not actuall score
-rw-r--r--contrib/other-builds/all.workspace4
-rw-r--r--moses/FF/RuleScope.cpp14
-rw-r--r--moses/FF/RuleScope.h1
3 files changed, 15 insertions, 4 deletions
diff --git a/contrib/other-builds/all.workspace b/contrib/other-builds/all.workspace
index b02bc5f31..90c72579b 100644
--- a/contrib/other-builds/all.workspace
+++ b/contrib/other-builds/all.workspace
@@ -8,8 +8,8 @@
<Project Name="OnDiskPt" Path="OnDiskPt/OnDiskPt.project" Active="No"/>
<Project Name="search" Path="search/search.project" Active="No"/>
<Project Name="moses" Path="moses/moses.project" Active="No"/>
- <Project Name="moses-cmd" Path="moses-cmd/moses-cmd.project" Active="No"/>
- <Project Name="score" Path="score/score.project" Active="Yes"/>
+ <Project Name="moses-cmd" Path="moses-cmd/moses-cmd.project" Active="Yes"/>
+ <Project Name="score" Path="score/score.project" Active="No"/>
<BuildMatrix>
<WorkspaceConfiguration Name="Debug" Selected="yes">
<Project Name="manual-label" ConfigName="Debug"/>
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;
};
}