diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2015-11-09 15:44:39 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2015-11-09 15:44:39 +0300 |
commit | d0be56f8abcb6842a37daaf696ef4e84d25db9ea (patch) | |
tree | c46d4027f2eab57b2c196662d1b3950cc19456d2 /moses/Hypothesis.cpp | |
parent | 176573c0724a65be8c36e5b5c3890d201f936d63 (diff) |
Consistent naming: total score -> m_futureScore
Diffstat (limited to 'moses/Hypothesis.cpp')
-rw-r--r-- | moses/Hypothesis.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/moses/Hypothesis.cpp b/moses/Hypothesis.cpp index de4f1849b..cb77a0811 100644 --- a/moses/Hypothesis.cpp +++ b/moses/Hypothesis.cpp @@ -53,7 +53,7 @@ Hypothesis(Manager& manager, InputType const& source, const TranslationOption &i m_sourceCompleted.GetFirstGapPos()>0 ? m_sourceCompleted.GetFirstGapPos()-1 : NOT_FOUND) , m_currTargetWordsRange(NOT_FOUND, NOT_FOUND) , m_wordDeleted(false) - , m_totalScore(0.0f) + , m_futureScore(0.0f) , m_estimatedScore(0.0f) , m_ffStates(StatefulFeatureFunction::GetStatefulFeatureFunctions().size()) , m_arcList(NULL) @@ -84,7 +84,7 @@ Hypothesis(const Hypothesis &prevHypo, const TranslationOption &transOpt, const prevHypo.m_currTargetWordsRange.GetEndPos() + transOpt.GetTargetPhrase().GetSize()) , m_wordDeleted(false) - , m_totalScore(0.0f) + , m_futureScore(0.0f) , m_estimatedScore(0.0f) , m_ffStates(prevHypo.m_ffStates.size()) , m_arcList(NULL) @@ -209,8 +209,8 @@ EvaluateWhenApplied(float futureScore) m_estimatedScore = futureScore; // TOTAL - m_totalScore = m_currScoreBreakdown.GetWeightedScore() + m_estimatedScore; - if (m_prevHypo) m_totalScore += m_prevHypo->GetScore(); + m_futureScore = m_currScoreBreakdown.GetWeightedScore() + m_estimatedScore; + if (m_prevHypo) m_futureScore += m_prevHypo->GetScore(); IFVERBOSE(2) { m_manager.GetSentenceStats().StopTimeEstimateScore(); @@ -247,7 +247,7 @@ PrintHypothesis() const TRACE_ERR( m_prevHypo->GetCurrTargetPhrase().GetSubString(range) << " "); } TRACE_ERR( ")"<<endl); - TRACE_ERR( "\tbase score "<< (m_prevHypo->m_totalScore - m_prevHypo->m_estimatedScore) <<endl); + TRACE_ERR( "\tbase score "<< (m_prevHypo->m_futureScore - m_prevHypo->m_estimatedScore) <<endl); TRACE_ERR( "\tcovering "<<m_currSourceWordsRange.GetStartPos()<<"-"<<m_currSourceWordsRange.GetEndPos() <<": " << m_transOpt.GetInputPath().GetPhrase() << endl); @@ -257,7 +257,7 @@ PrintHypothesis() const // TRACE_ERR( "\tdistance: "<<GetCurrSourceWordsRange().CalcDistortion(m_prevHypo->GetCurrSourceWordsRange())); // << " => distortion cost "<<(m_score[ScoreType::Distortion]*weightDistortion)<<endl; // TRACE_ERR( "\tlanguage model cost "); // <<m_score[ScoreType::LanguageModelScore]<<endl; // TRACE_ERR( "\tword penalty "); // <<(m_score[ScoreType::WordPenalty]*weightWordPenalty)<<endl; - TRACE_ERR( "\tscore "<<m_totalScore - m_estimatedScore<<" + future cost "<<m_estimatedScore<<" = "<<m_totalScore<<endl); + TRACE_ERR( "\tscore "<<m_futureScore - m_estimatedScore<<" + future cost "<<m_estimatedScore<<" = "<<m_futureScore<<endl); TRACE_ERR( "\tunweighted feature scores: " << m_currScoreBreakdown << endl); //PrintLMScores(); } @@ -326,7 +326,7 @@ ostream& operator<<(ostream& out, const Hypothesis& hypo) out << "[" << hypo.m_sourceCompleted << "] "; // scores - out << " [total=" << hypo.GetTotalScore() << "]"; + out << " [total=" << hypo.GetFutureScore() << "]"; out << " " << hypo.GetScoreBreakdown(); // alignment @@ -607,8 +607,8 @@ bool Hypothesis:: beats(Hypothesis const& b) const { - if (m_totalScore != b.m_totalScore) - return m_totalScore > b.m_totalScore; + if (m_futureScore != b.m_futureScore) + return m_futureScore > b.m_futureScore; else if (m_estimatedScore != b.m_estimatedScore) return m_estimatedScore > b.m_estimatedScore; else if (m_prevHypo) |