abort if try to get substring of confusion network. returning emptyy string just screws things up

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1868 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
hieuhoang1972 2008-07-30 16:29:51 +00:00
parent 03bd63e312
commit dd9691d28c
2 changed files with 4 additions and 1 deletions

View File

@ -178,6 +178,7 @@ void ConfusionNet::Print(std::ostream& out) const {
Phrase ConfusionNet::GetSubString(const WordsRange&) const {
TRACE_ERR("ERROR: call to ConfusionNet::GetSubString\n");
abort();
return Phrase(Input);
}

View File

@ -191,6 +191,7 @@ float LanguageModelIRST::GetValue(const vector<const Word*> &contextFactor, Stat
cout << "i=" << i << " -> " << (*contextFactor[i])[factorType]->GetString() << "\n";
#endif
int lmId = GetLmID((*contextFactor[i])[factorType]->GetString());
cerr << (*contextFactor[i])[factorType]->GetString() << " = " << lmId;
m_lmtb_ng->pushc(lmId);
}
@ -200,7 +201,8 @@ float LanguageModelIRST::GetValue(const vector<const Word*> &contextFactor, Stat
*len = 0;
}
return TransformIRSTScore((float) m_lmtb->clprob(*m_lmtb_ng));
float prob = m_lmtb->clprob(*m_lmtb_ng);
return TransformIRSTScore(prob);
}