consistent naming of future scores, estimated scores

This commit is contained in:
Hieu Hoang 2015-11-03 09:58:39 +00:00
parent 5f3ab98044
commit c118849e97
16 changed files with 22 additions and 22 deletions

View File

@ -65,7 +65,7 @@ void
Distortion::EvaluateInIsolation(const System &system,
const PhraseBase &source, const TargetPhrase &targetPhrase,
Scores &scores,
Scores *estimatedFutureScores) const
Scores *estimatedScore) const
{
}

View File

@ -25,7 +25,7 @@ public:
const PhraseBase &source,
const TargetPhrase &targetPhrase,
Scores &scores,
Scores *estimatedFutureScores) const;
Scores *estimatedScore) const;
virtual Moses::FFState* EvaluateWhenApplied(const Manager &mgr,
const Hypothesis &hypo,

View File

@ -41,7 +41,7 @@ public:
EvaluateInIsolation(const System &system,
const PhraseBase &source, const TargetPhrase &targetPhrase,
Scores &scores,
Scores *estimatedFutureScores) const = 0;
Scores *estimatedScore) const = 0;
protected:
size_t m_startInd;

View File

@ -150,15 +150,15 @@ FeatureFunctions::EvaluateInIsolation(MemPool &pool, const System &system,
const PhraseBase &source, TargetPhrase &targetPhrase) const
{
size_t numScores = system.GetFeatureFunctions().GetNumScores();
Scores *estimatedFutureScores = new (pool.Allocate<Scores>()) Scores(pool, numScores);
Scores *estimatedScore = new (pool.Allocate<Scores>()) Scores(pool, numScores);
BOOST_FOREACH(const FeatureFunction *ff, m_featureFunctions) {
Scores& scores = targetPhrase.GetScores();
ff->EvaluateInIsolation(system, source, targetPhrase, scores, estimatedFutureScores);
ff->EvaluateInIsolation(system, source, targetPhrase, scores, estimatedScore);
}
if (estimatedFutureScores) {
targetPhrase.SetEstimatedScore(estimatedFutureScores->GetTotalScore());
if (estimatedScore) {
targetPhrase.SetEstimatedScore(estimatedScore->GetTotalScore());
}
}

View File

@ -126,7 +126,7 @@ void
LanguageModel::EvaluateInIsolation(const System &system,
const PhraseBase &source, const TargetPhrase &targetPhrase,
Scores &scores,
Scores *estimatedFutureScores) const
Scores *estimatedScore) const
{
if (targetPhrase.GetSize() == 0) {
return;
@ -146,15 +146,15 @@ LanguageModel::EvaluateInIsolation(const System &system,
std::pair<SCORE, void*> fromScoring = Score(context);
score += fromScoring.first;
}
else if (estimatedFutureScores) {
else if (estimatedScore) {
std::pair<SCORE, void*> fromScoring = Score(context);
nonFullScore += fromScoring.first;
}
}
scores.PlusEquals(system, *this, score);
if (estimatedFutureScores) {
estimatedFutureScores->PlusEquals(system, *this, nonFullScore);
if (estimatedScore) {
estimatedScore->PlusEquals(system, *this, nonFullScore);
}
}

View File

@ -56,7 +56,7 @@ public:
EvaluateInIsolation(const System &system,
const PhraseBase &source, const TargetPhrase &targetPhrase,
Scores &scores,
Scores *estimatedFutureScores) const;
Scores *estimatedScore) const;
virtual Moses::FFState* EvaluateWhenApplied(const Manager &mgr,
const Hypothesis &hypo,

View File

@ -65,7 +65,7 @@ void
PhraseTable::EvaluateInIsolation(const System &system,
const PhraseBase &source, const TargetPhrase &targetPhrase,
Scores &scores,
Scores *estimatedFutureScores) const
Scores *estimatedScore) const
{
}

View File

@ -37,7 +37,7 @@ public:
EvaluateInIsolation(const System &system,
const PhraseBase &source, const TargetPhrase &targetPhrase,
Scores &scores,
Scores *estimatedFutureScores) const;
Scores *estimatedScore) const;
protected:
std::string m_path;

View File

@ -45,7 +45,7 @@ void
SkeletonStatefulFF::EvaluateInIsolation(const System &system,
const PhraseBase &source, const TargetPhrase &targetPhrase,
Scores &scores,
Scores *estimatedFutureScores) const
Scores *estimatedScore) const
{
}

View File

@ -22,7 +22,7 @@ public:
EvaluateInIsolation(const System &system,
const PhraseBase &source, const TargetPhrase &targetPhrase,
Scores &scores,
Scores *estimatedFutureScores) const;
Scores *estimatedScore) const;
virtual Moses::FFState* EvaluateWhenApplied(const Manager &mgr,
const Hypothesis &hypo,

View File

@ -21,7 +21,7 @@ void
SkeletonStatelessFF::EvaluateInIsolation(const System &system,
const PhraseBase &source, const TargetPhrase &targetPhrase,
Scores &scores,
Scores *estimatedFutureScores) const
Scores *estimatedScore) const
{
}

View File

@ -19,6 +19,6 @@ public:
EvaluateInIsolation(const System &system,
const PhraseBase &source, const TargetPhrase &targetPhrase,
Scores &scores,
Scores *estimatedFutureScores) const;
Scores *estimatedScore) const;
};

View File

@ -71,7 +71,7 @@ void
UnknownWordPenalty::EvaluateInIsolation(const System &system,
const PhraseBase &source, const TargetPhrase &targetPhrase,
Scores &scores,
Scores *estimatedFutureScores) const
Scores *estimatedScore) const
{
}

View File

@ -22,7 +22,7 @@ public:
EvaluateInIsolation(const System &system,
const PhraseBase &source, const TargetPhrase &targetPhrase,
Scores &scores,
Scores *estimatedFutureScores) const;
Scores *estimatedScore) const;
};

View File

@ -26,7 +26,7 @@ WordPenalty::EvaluateInIsolation(const System &system,
const PhraseBase &source,
const TargetPhrase &targetPhrase,
Scores &scores,
Scores *estimatedFutureScores) const
Scores *estimatedScore) const
{
SCORE score = - (SCORE) targetPhrase.GetSize();
scores.PlusEquals(system, *this, score);

View File

@ -21,7 +21,7 @@ public:
const PhraseBase &source,
const TargetPhrase &targetPhrase,
Scores &scores,
Scores *estimatedFutureScores) const;
Scores *estimatedScore) const;
};