diff --git a/moses/ChartTranslationOptionList.cpp b/moses/ChartTranslationOptionList.cpp index e83fbac79..b86312b9d 100644 --- a/moses/ChartTranslationOptionList.cpp +++ b/moses/ChartTranslationOptionList.cpp @@ -163,8 +163,14 @@ float ChartTranslationOptionList::GetBestScore(const ChartCellLabel *chartCell) { const HypoList *stack = chartCell->GetStack().cube; assert(stack); - assert(!stack->empty()); - const ChartHypothesis &bestHypo = **(stack->begin()); + //assert(!stack->empty()); + if (stack->empty()) { + return 0; + } + else { + const ChartHypothesis &bestHypo = **(stack->begin()); + return bestHypo.GetTotalScore(); + } const ChartHypothesis &bestHypo = **(stack->begin()); return bestHypo.GetTotalScore(); } diff --git a/moses/TranslationModel/RuleTable/LoaderStandard.cpp b/moses/TranslationModel/RuleTable/LoaderStandard.cpp index 9d2e3fa20..47f7378d1 100644 --- a/moses/TranslationModel/RuleTable/LoaderStandard.cpp +++ b/moses/TranslationModel/RuleTable/LoaderStandard.cpp @@ -218,7 +218,7 @@ bool RuleTableLoaderStandard::Load(FormatType format // parse source & find pt node // constituent labels - Word *sourceLHS; + Word *sourceLHS = NULL; Word *targetLHS; // create target phrase obj @@ -251,6 +251,9 @@ bool RuleTableLoaderStandard::Load(FormatType format TargetPhraseCollection &phraseColl = GetOrCreateTargetPhraseCollection(ruleTable, sourcePhrase, *targetPhrase, sourceLHS); phraseColl.Add(targetPhrase); + // not implemented correctly in memory pt. just delete it for now + delete sourceLHS; + count++; }