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/HypothesisStackNormal.cpp | |
parent | 176573c0724a65be8c36e5b5c3890d201f936d63 (diff) |
Consistent naming: total score -> m_futureScore
Diffstat (limited to 'moses/HypothesisStackNormal.cpp')
-rw-r--r-- | moses/HypothesisStackNormal.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/moses/HypothesisStackNormal.cpp b/moses/HypothesisStackNormal.cpp index 77347baaf..56ca4f8a5 100644 --- a/moses/HypothesisStackNormal.cpp +++ b/moses/HypothesisStackNormal.cpp @@ -57,17 +57,17 @@ pair<HypothesisStackNormal::iterator, bool> HypothesisStackNormal::Add(Hypothesi VERBOSE(3,"added hyp to stack"); // Update best score, if this hypothesis is new best - if (hypo->GetTotalScore() > m_bestScore) { + if (hypo->GetFutureScore() > m_bestScore) { VERBOSE(3,", best on stack"); - m_bestScore = hypo->GetTotalScore(); + m_bestScore = hypo->GetFutureScore(); // this may also affect the worst score if ( m_bestScore + m_beamWidth > m_worstScore ) m_worstScore = m_bestScore + m_beamWidth; } // update best/worst score for stack diversity 1 if ( m_minHypoStackDiversity == 1 && - hypo->GetTotalScore() > GetWorstScoreForBitmap( hypo->GetWordsBitmap() ) ) { - SetWorstScoreForBitmap( hypo->GetWordsBitmap().GetID(), hypo->GetTotalScore() ); + hypo->GetFutureScore() > GetWorstScoreForBitmap( hypo->GetWordsBitmap() ) ) { + SetWorstScoreForBitmap( hypo->GetWordsBitmap().GetID(), hypo->GetFutureScore() ); } VERBOSE(3,", now size " << m_hypos.size()); @@ -89,7 +89,7 @@ pair<HypothesisStackNormal::iterator, bool> HypothesisStackNormal::Add(Hypothesi bool HypothesisStackNormal::AddPrune(Hypothesis *hypo) { - if (hypo->GetTotalScore() == - std::numeric_limits<float>::infinity()) { + if (hypo->GetFutureScore() == - std::numeric_limits<float>::infinity()) { m_manager.GetSentenceStats().AddDiscarded(); VERBOSE(3,"discarded, constraint" << std::endl); delete hypo; @@ -98,9 +98,9 @@ bool HypothesisStackNormal::AddPrune(Hypothesis *hypo) // too bad for stack. don't bother adding hypo into collection if (!StaticData::Instance().GetDisableDiscarding() && - hypo->GetTotalScore() < m_worstScore + hypo->GetFutureScore() < m_worstScore && ! ( m_minHypoStackDiversity > 0 - && hypo->GetTotalScore() >= GetWorstScoreForBitmap( hypo->GetWordsBitmap() ) ) ) { + && hypo->GetFutureScore() >= GetWorstScoreForBitmap( hypo->GetWordsBitmap() ) ) ) { m_manager.GetSentenceStats().AddDiscarded(); VERBOSE(3,"discarded, too bad for stack" << std::endl); delete hypo; @@ -123,7 +123,7 @@ bool HypothesisStackNormal::AddPrune(Hypothesis *hypo) // found existing hypo with same target ending. // keep the best 1 - if (hypo->GetTotalScore() > hypoExisting->GetTotalScore()) { + if (hypo->GetFutureScore() > hypoExisting->GetFutureScore()) { // incoming hypo is better than the one we have VERBOSE(3,"better than matching hyp " << hypoExisting->GetId() << ", recombining, "); if (m_nBestIsEnabled) { @@ -181,7 +181,7 @@ void HypothesisStackNormal::PruneToSize(size_t newSize) included[i] = true; diversityCount[ coverage ]++; if (diversityCount[ coverage ] == m_minHypoStackDiversity) - SetWorstScoreForBitmap( coverage, hyp->GetTotalScore()); + SetWorstScoreForBitmap( coverage, hyp->GetFutureScore()); } } } @@ -192,12 +192,12 @@ void HypothesisStackNormal::PruneToSize(size_t newSize) // add best remaining hypotheses for(size_t i=0; i<hypos.size() && size() < newSize - && hypos[i]->GetTotalScore() > m_bestScore+m_beamWidth; i++) { + && hypos[i]->GetFutureScore() > m_bestScore+m_beamWidth; i++) { if (! included[i]) { m_hypos.insert( hypos[i] ); included[i] = true; if (size() == newSize) - m_worstScore = hypos[i]->GetTotalScore(); + m_worstScore = hypos[i]->GetFutureScore(); } } } @@ -217,7 +217,7 @@ void HypothesisStackNormal::PruneToSize(size_t newSize) TRACE_ERR("stack now contains: "); for(iterator iter = m_hypos.begin(); iter != m_hypos.end(); iter++) { Hypothesis *hypo = *iter; - TRACE_ERR( hypo->GetId() << " (" << hypo->GetTotalScore() << ") "); + TRACE_ERR( hypo->GetId() << " (" << hypo->GetFutureScore() << ") "); } TRACE_ERR( endl); } @@ -230,7 +230,7 @@ const Hypothesis *HypothesisStackNormal::GetBestHypothesis() const Hypothesis *bestHypo = *iter; while (++iter != m_hypos.end()) { Hypothesis *hypo = *iter; - if (hypo->GetTotalScore() > bestHypo->GetTotalScore()) + if (hypo->GetFutureScore() > bestHypo->GetFutureScore()) bestHypo = hypo; } return bestHypo; |