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:
authorUlrich Germann <Ulrich.Germann@gmail.com>2015-10-31 15:50:52 +0300
committerUlrich Germann <Ulrich.Germann@gmail.com>2015-10-31 15:50:52 +0300
commit324c378f7fc54f02a8ea264915d3eade867ff23d (patch)
tree2bb934fee448845b0524427d437c871e7118ac2c /moses/ChartManager.cpp
parentdc8ad899454bd82408c6a371d5f50e497ede0caa (diff)
Options refactoring. Moses crashed in server mode when asked to provide n-best translations with scores.
Diffstat (limited to 'moses/ChartManager.cpp')
-rw-r--r--moses/ChartManager.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/moses/ChartManager.cpp b/moses/ChartManager.cpp
index 9c672e00a..767c5b44b 100644
--- a/moses/ChartManager.cpp
+++ b/moses/ChartManager.cpp
@@ -371,7 +371,8 @@ void ChartManager::OutputNBestList(OutputCollector *collector,
OutputSurface(out, outputPhrase, outputFactorOrder, false);
out << " ||| ";
boost::shared_ptr<ScoreComponentCollection> scoreBreakdown = ChartKBestExtractor::GetOutputScoreBreakdown(derivation);
- scoreBreakdown->OutputAllFeatureScores(out);
+ bool with_labels = options().nbest.include_feature_labels;
+ scoreBreakdown->OutputAllFeatureScores(out, with_labels);
out << " ||| " << derivation.score;
// optionally, print word alignments
@@ -618,7 +619,7 @@ void ChartManager::OutputDetailedTranslationReport(
//DIMw
const StaticData &staticData = StaticData::Instance();
- if (staticData.IsDetailedAllTranslationReportingEnabled()) {
+ if (options().output.detailed_all_transrep_filepath.size()) {
const Sentence &sentence = static_cast<const Sentence &>(m_source);
size_t nBestSize = staticData.options().nbest.nbest_size;
std::vector<boost::shared_ptr<ChartKBestExtractor::Derivation> > nBestList;
@@ -835,11 +836,11 @@ void ChartManager::OutputBestHypo(OutputCollector *collector, const ChartHypothe
Backtrack(hypo);
VERBOSE(3,"0" << std::endl);
- if (StaticData::Instance().GetOutputHypoScore()) {
+ if (options().output.ReportHypoScore) {
out << hypo->GetTotalScore() << " ";
}
- if (StaticData::Instance().IsPathRecoveryEnabled()) {
+ if (options().output.RecoverPath) {
out << "||| ";
}
Phrase outPhrase(ARRAY_SIZE_INCR);
@@ -858,7 +859,7 @@ void ChartManager::OutputBestHypo(OutputCollector *collector, const ChartHypothe
} else {
VERBOSE(1, "NO BEST TRANSLATION" << endl);
- if (StaticData::Instance().GetOutputHypoScore()) {
+ if (options().output.ReportHypoScore) {
out << "0 ";
}