diff options
author | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-24 21:18:01 +0000 |
---|---|---|
committer | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-24 21:18:01 +0000 |
commit | 2cb224de7db49b761ac06b031090fe7f846744fe (patch) | |
tree | dc1d4e949081ea0e0868773bd7a31b96faa77487 /decoder/hg_io.cc | |
parent | 1fbdaa4d49acf90d2124aef8810d723ddbb0dad5 (diff) |
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
Diffstat (limited to 'decoder/hg_io.cc')
-rw-r--r-- | decoder/hg_io.cc | 3 |
1 files changed, 2 insertions, 1 deletions
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<LatticeArc>& 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_; } } |