mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-08 04:27:53 +03:00
get ready for evaluation
This commit is contained in:
parent
d667f57342
commit
63b72425fa
@ -176,8 +176,8 @@ void Hypothesis::EvaluateWhenApplied()
|
||||
const std::vector<const StatefulFeatureFunction*> &sfffs =
|
||||
GetManager().system.featureFunctions.GetStatefulFeatureFunctions();
|
||||
BOOST_FOREACH(const StatefulFeatureFunction *sfff, sfffs){
|
||||
EvaluateWhenApplied(*sfff);
|
||||
}
|
||||
EvaluateWhenApplied(*sfff);
|
||||
}
|
||||
//cerr << *this << endl;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,9 @@
|
||||
#include <boost/foreach.hpp>
|
||||
#include "Hypothesis.h"
|
||||
#include "Manager.h"
|
||||
#include "../System.h"
|
||||
#include "../Scores.h"
|
||||
#include "../FF/StatefulFeatureFunction.h"
|
||||
|
||||
namespace Moses2
|
||||
{
|
||||
@ -19,11 +23,17 @@ void Hypothesis::Init(SCFG::Manager &mgr, const InputPathBase &path, const SCFG:
|
||||
|
||||
SCORE Hypothesis::GetFutureScore() const
|
||||
{
|
||||
|
||||
return GetScores().GetTotalScore();
|
||||
}
|
||||
|
||||
void Hypothesis::EvaluateWhenApplied()
|
||||
{
|
||||
const std::vector<const StatefulFeatureFunction*> &sfffs =
|
||||
GetManager().system.featureFunctions.GetStatefulFeatureFunctions();
|
||||
BOOST_FOREACH(const StatefulFeatureFunction *sfff, sfffs){
|
||||
//EvaluateWhenApplied(*sfff);
|
||||
}
|
||||
//cerr << *this << endl;
|
||||
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,8 @@ void Manager::Decode(size_t startPos, size_t size)
|
||||
SCFG::Hypothesis *hypo = new SCFG::Hypothesis(GetPool(), system);
|
||||
hypo->Init(*this, path, tp);
|
||||
|
||||
stack.Add(hypo, hypoRecycler, arcLists);
|
||||
StackAdd added = stack.Add(hypo, hypoRecycler, arcLists);
|
||||
cerr << "added=" << added.added << " " << (const Phrase&) tp << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,14 +15,14 @@ Stack::Stack(const Manager &mgr)
|
||||
{
|
||||
}
|
||||
|
||||
void Stack::Add(SCFG::Hypothesis *hypo, Recycler<HypothesisBase*> &hypoRecycle,
|
||||
StackAdd Stack::Add(SCFG::Hypothesis *hypo, Recycler<HypothesisBase*> &hypoRecycle,
|
||||
ArcLists &arcLists)
|
||||
{
|
||||
const SCFG::TargetPhraseImpl &tp = hypo->GetTargetPhrase();
|
||||
const SCFG::Word &lhs = tp.lhs;
|
||||
HypothesisColl &coll = GetMiniStack(lhs);
|
||||
StackAdd added = coll.Add(hypo);
|
||||
|
||||
return added;
|
||||
}
|
||||
|
||||
Moses2::HypothesisColl &Stack::GetMiniStack(const SCFG::Word &key)
|
||||
|
@ -32,7 +32,7 @@ public:
|
||||
|
||||
size_t GetSize() const;
|
||||
|
||||
void Add(SCFG::Hypothesis *hypo, Recycler<HypothesisBase*> &hypoRecycle,
|
||||
StackAdd Add(SCFG::Hypothesis *hypo, Recycler<HypothesisBase*> &hypoRecycle,
|
||||
ArcLists &arcLists);
|
||||
|
||||
protected:
|
||||
|
Loading…
Reference in New Issue
Block a user