summaryrefslogtreecommitdiff
path: root/decoder/hg.cc
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/hg.cc')
-rw-r--r--decoder/hg.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/decoder/hg.cc b/decoder/hg.cc
index 1e2a0010..8a6c8228 100644
--- a/decoder/hg.cc
+++ b/decoder/hg.cc
@@ -70,7 +70,9 @@ prob_t Hypergraph::ComputeEdgeViterbi(EdgeProbs *ev) const {
}
prob_t Hypergraph::ComputeEdgeViterbi(NodeProbs const& nv,EdgeProbs *ev) const {
- for (int i=0;i<edges_.size();++i) {
+ int ne=edges_.size();
+ ev->resize(ne);
+ for (int i=0;i<ne;++i) {
Edge const& e=edges_[i];
prob_t r=e.edge_prob_;
TailNodeVector const& t=e.tail_nodes_;