set sortScore even when log prob

This commit is contained in:
Hieu Hoang 2016-07-15 16:25:48 +01:00
parent 7fa586aa9b
commit 1c818b270b
3 changed files with 16 additions and 13 deletions

View File

@ -74,6 +74,19 @@ public:
protected:
};
template<typename TP>
struct CompareSortScore
{
bool operator()(const TP *a, const TP *b) const
{
SCORE scoreA = a->sortScore;
SCORE scoreB = b->sortScore;
return scoreA > scoreB;
}
};
}
}

View File

@ -75,18 +75,5 @@ struct CompareFutureScore
}
};
template<typename TP>
struct CompareSortScore
{
bool operator()(const TP *a, const TP *b) const
{
SCORE scoreA = a->sortScore;
SCORE scoreB = b->sortScore;
return scoreA > scoreB;
}
};
} /* namespace Moses2a */

View File

@ -591,6 +591,9 @@ SCFG::TargetPhraseImpl *ProbingPT::CreateTargetPhraseSCFG(
// set pt score for rule
tp->GetScores().PlusEquals(system, *this, scores);
// sort score. Just for scfg
tp->sortScore = (totalNumScores >= 3) ? scores[2] : 0;
// save scores for other FF, eg. lex RO. Just give the offset
if (m_engine->num_lex_scores) {
tp->scoreProperties = scores + m_engine->num_scores;