allow no best hypo

This commit is contained in:
Hieu Hoang 2013-09-18 15:57:59 +02:00
parent 24f1760c05
commit 692dc1c05f

View File

@ -126,13 +126,13 @@ const ChartHypothesis *ChartCell::GetBestHypothesis() const
MapType::const_iterator iter; MapType::const_iterator iter;
for (iter = m_hypoColl.begin(); iter != m_hypoColl.end(); ++iter) { for (iter = m_hypoColl.begin(); iter != m_hypoColl.end(); ++iter) {
const HypoList &sortedList = iter->second.GetSortedHypotheses(); const HypoList &sortedList = iter->second.GetSortedHypotheses();
CHECK(sortedList.size() > 0); if (sortedList.size() > 0) {
const ChartHypothesis *hypo = sortedList[0];
const ChartHypothesis *hypo = sortedList[0]; if (hypo->GetTotalScore() > bestScore) {
if (hypo->GetTotalScore() > bestScore) { bestScore = hypo->GetTotalScore();
bestScore = hypo->GetTotalScore(); ret = hypo;
ret = hypo; }
}; }
} }
return ret; return ret;