From d8fa7f3e9b8127911996c36f477bcae3831f7708 Mon Sep 17 00:00:00 2001 From: graehl Date: Tue, 31 Aug 2010 01:56:56 +0000 Subject: l2r bugfixes git-svn-id: https://ws10smt.googlecode.com/svn/trunk@635 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/viterbi.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'decoder/viterbi.h') diff --git a/decoder/viterbi.h b/decoder/viterbi.h index e78cd157..ac0b9a11 100644 --- a/decoder/viterbi.h +++ b/decoder/viterbi.h @@ -55,6 +55,8 @@ typename WeightFunction::Weight Viterbi(const Hypergraph& hg, antsb[k] = &vit_result[edgeb.tail_nodes_[k]]; traverse(edgeb, antsb, cur_node_best_result); } + if (vit_result.empty()) + return WeightType(0); std::swap(*result, vit_result.back()); return vit_weight.back(); } -- cgit v1.2.3