mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-11-10 10:59:21 +03:00
comment out deletion of hypos with -inf scores. Apparently, all stacks must have hypos, otherwise terrible things happens. This is weird, empty stacks is perfectly reasonable. Need to ask Phil about this
This commit is contained in:
parent
21319acb88
commit
8fe087a92d
@ -182,6 +182,25 @@ void ChartHypothesisCollection::Remove(const HCType::iterator &iter)
|
||||
*/
|
||||
void ChartHypothesisCollection::PruneToSize(ChartManager &manager)
|
||||
{
|
||||
/*
|
||||
const Phrase *ref = manager.GetConstraint();
|
||||
if (ref) {
|
||||
// delete all hypos with -inf scores.
|
||||
HCType::iterator iter = m_hypos.begin();
|
||||
while (iter != m_hypos.end()) {
|
||||
ChartHypothesis *hypo = *iter;
|
||||
float score = hypo->GetTotalScore();
|
||||
if (score == - std::numeric_limits<float>::infinity()) {
|
||||
HCType::iterator iterRemove = iter++;
|
||||
Remove(iterRemove);
|
||||
manager.GetSentenceStats().AddPruning();
|
||||
} else {
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (GetSize() > m_maxHypoStackSize) { // ok, if not over the limit
|
||||
priority_queue<float> bestScores;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user