mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 05:14:36 +03:00
minor leak
This commit is contained in:
parent
e22b68e2fd
commit
00505ba048
@ -163,8 +163,14 @@ float ChartTranslationOptionList::GetBestScore(const ChartCellLabel *chartCell)
|
|||||||
{
|
{
|
||||||
const HypoList *stack = chartCell->GetStack().cube;
|
const HypoList *stack = chartCell->GetStack().cube;
|
||||||
assert(stack);
|
assert(stack);
|
||||||
assert(!stack->empty());
|
//assert(!stack->empty());
|
||||||
const ChartHypothesis &bestHypo = **(stack->begin());
|
if (stack->empty()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const ChartHypothesis &bestHypo = **(stack->begin());
|
||||||
|
return bestHypo.GetTotalScore();
|
||||||
|
} const ChartHypothesis &bestHypo = **(stack->begin());
|
||||||
return bestHypo.GetTotalScore();
|
return bestHypo.GetTotalScore();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ bool RuleTableLoaderStandard::Load(FormatType format
|
|||||||
// parse source & find pt node
|
// parse source & find pt node
|
||||||
|
|
||||||
// constituent labels
|
// constituent labels
|
||||||
Word *sourceLHS;
|
Word *sourceLHS = NULL;
|
||||||
Word *targetLHS;
|
Word *targetLHS;
|
||||||
|
|
||||||
// create target phrase obj
|
// create target phrase obj
|
||||||
@ -251,6 +251,9 @@ bool RuleTableLoaderStandard::Load(FormatType format
|
|||||||
TargetPhraseCollection &phraseColl = GetOrCreateTargetPhraseCollection(ruleTable, sourcePhrase, *targetPhrase, sourceLHS);
|
TargetPhraseCollection &phraseColl = GetOrCreateTargetPhraseCollection(ruleTable, sourcePhrase, *targetPhrase, sourceLHS);
|
||||||
phraseColl.Add(targetPhrase);
|
phraseColl.Add(targetPhrase);
|
||||||
|
|
||||||
|
// not implemented correctly in memory pt. just delete it for now
|
||||||
|
delete sourceLHS;
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user