diff options
author | David Madl <git@abanbytes.eu> | 2015-11-13 15:05:05 +0300 |
---|---|---|
committer | David Madl <git@abanbytes.eu> | 2015-11-17 19:15:13 +0300 |
commit | b1ea3d624b638b4b6caf25099f4e1f44f33dae8c (patch) | |
tree | 9510ac6bcf43f8e7628d1e1b0f22986c40533a98 /moses/Hypothesis.cpp | |
parent | e5a8438149e73c30840ef41c5a75a4288c75846b (diff) |
Dump two ugly, old overrides of Hypothesis::EvaluateWhenApplied()
A Brief History of Time:
65ddbf3 7/2/12 Wilson, "Implement batched LM requests."
776da79 8/6/15 Hoang, "delete old unused code"
Diffstat (limited to 'moses/Hypothesis.cpp')
-rw-r--r-- | moses/Hypothesis.cpp | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/moses/Hypothesis.cpp b/moses/Hypothesis.cpp index 78d14f8a1..8f5551e13 100644 --- a/moses/Hypothesis.cpp +++ b/moses/Hypothesis.cpp @@ -141,30 +141,6 @@ AddArc(Hypothesis *loserHypo) m_arcList->push_back(loserHypo); } -void -Hypothesis:: -EvaluateWhenApplied(StatefulFeatureFunction const& sfff, int state_idx) -{ - const StaticData &staticData = StaticData::Instance(); - if (! staticData.IsFeatureFunctionIgnored( sfff )) { - // Manager& manager = this->GetManager(); //Get the manager and the ttask - // ttasksptr const& ttask = manager.GetTtask(); - FFState const* prev = m_prevHypo ? m_prevHypo->m_ffStates[state_idx] : NULL; - m_ffStates[state_idx] - = sfff.EvaluateWhenApplied(*this, prev, &m_currScoreBreakdown); - } -} - -void -Hypothesis:: -EvaluateWhenApplied(const StatelessFeatureFunction& slff) -{ - const StaticData &staticData = StaticData::Instance(); - if (! staticData.IsFeatureFunctionIgnored( slff )) { - slff.EvaluateWhenApplied(*this, &m_currScoreBreakdown); - } -} - /*** * calculate the logarithm of our total translation score (sum up components) */ @@ -172,6 +148,8 @@ void Hypothesis:: EvaluateWhenApplied(float estimatedScore) { + const StaticData &staticData = StaticData::Instance(); + IFVERBOSE(2) { m_manager.GetSentenceStats().StartTimeOtherScore(); } @@ -186,15 +164,16 @@ EvaluateWhenApplied(float estimatedScore) StatelessFeatureFunction::GetStatelessFeatureFunctions(); for (unsigned i = 0; i < sfs.size(); ++i) { const StatelessFeatureFunction &ff = *sfs[i]; - EvaluateWhenApplied(ff); + if(!staticData.IsFeatureFunctionIgnored(ff)) { + ff.EvaluateWhenApplied(*this, &m_currScoreBreakdown); + } } const vector<const StatefulFeatureFunction*>& ffs = StatefulFeatureFunction::GetStatefulFeatureFunctions(); for (unsigned i = 0; i < ffs.size(); ++i) { const StatefulFeatureFunction &ff = *ffs[i]; - const StaticData &staticData = StaticData::Instance(); - if (! staticData.IsFeatureFunctionIgnored(ff)) { + if(!staticData.IsFeatureFunctionIgnored(ff)) { FFState const* s = m_prevHypo ? m_prevHypo->m_ffStates[i] : NULL; m_ffStates[i] = ff.EvaluateWhenApplied(*this, s, &m_currScoreBreakdown); } |