From 2cb224de7db49b761ac06b031090fe7f846744fe Mon Sep 17 00:00:00 2001 From: graehl Date: Sat, 24 Jul 2010 21:18:01 +0000 Subject: FSA: simpler Scan1 ScanT1 methods, otherewise also expose edge to full Scan git-svn-id: https://ws10smt.googlecode.com/svn/trunk@399 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/hg_io.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'decoder/hg_io.cc') diff --git a/decoder/hg_io.cc b/decoder/hg_io.cc index d6e73b8a..65c2c382 100644 --- a/decoder/hg_io.cc +++ b/decoder/hg_io.cc @@ -556,6 +556,7 @@ void HypergraphIO::PLFtoLattice(const string& plf, Lattice* pl) { ReadFromPLF(plf, &g, 0); const int num_nodes = g.nodes_.size() - 1; l.resize(num_nodes); + int fid0=FD::Convert("Feature_0"); for (int i = 0; i < num_nodes; ++i) { vector& alts = l[i]; const Hypergraph::Node& node = g.nodes_[i]; @@ -564,7 +565,7 @@ void HypergraphIO::PLFtoLattice(const string& plf, Lattice* pl) { for (int j = 0; j < num_alts; ++j) { const Hypergraph::Edge& edge = g.edges_[node.out_edges_[j]]; alts[j].label = edge.rule_->e_[1]; - alts[j].cost = edge.feature_values_.value(FD::Convert("Feature_0")); + alts[j].cost = edge.feature_values_.get(fid0); alts[j].dist2next = edge.head_node_ - node.id_; } } -- cgit v1.2.3