mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-30 15:34:01 +03:00
Eliminated EvaluateWhenAppliedWithContext().
The Phrase class now provides access to the TranslationTask.
This commit is contained in:
parent
8ace1398eb
commit
8c4e017fbf
@ -1,3 +1,4 @@
|
||||
// -*- mode: c++; indent-tabs-mode: nil; tab-width:2 -*-
|
||||
#pragma once
|
||||
|
||||
#include "FeatureFunction.h"
|
||||
@ -37,13 +38,13 @@ public:
|
||||
const FFState* prev_state,
|
||||
ScoreComponentCollection* accumulator) const = 0;
|
||||
|
||||
virtual FFState* EvaluateWhenAppliedWithContext(
|
||||
ttasksptr const& ttasks,
|
||||
const Hypothesis& cur_hypo,
|
||||
const FFState* prev_state,
|
||||
ScoreComponentCollection* accumulator) const {
|
||||
return EvaluateWhenApplied(cur_hypo, prev_state, accumulator);
|
||||
}
|
||||
// virtual FFState* EvaluateWhenAppliedWithContext(
|
||||
// ttasksptr const& ttasks,
|
||||
// const Hypothesis& cur_hypo,
|
||||
// const FFState* prev_state,
|
||||
// ScoreComponentCollection* accumulator) const {
|
||||
// return EvaluateWhenApplied(cur_hypo, prev_state, accumulator);
|
||||
// }
|
||||
|
||||
virtual FFState* EvaluateWhenApplied(
|
||||
const ChartHypothesis& /* cur_hypo */,
|
||||
|
@ -143,17 +143,15 @@ AddArc(Hypothesis *loserHypo)
|
||||
|
||||
void
|
||||
Hypothesis::
|
||||
EvaluateWhenApplied(StatefulFeatureFunction const& sfff,
|
||||
int state_idx)
|
||||
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();
|
||||
|
||||
m_ffStates[state_idx] = sfff.EvaluateWhenAppliedWithContext
|
||||
(ttask, *this, m_prevHypo ? m_prevHypo->m_ffStates[state_idx] : NULL,
|
||||
&m_currScoreBreakdown);
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user