summaryrefslogtreecommitdiff
path: root/decoder/hg_io.cc
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-24 21:18:01 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-24 21:18:01 +0000
commit5bc0b9b1fc76064d13d2c553c019a381ee52dfa1 (patch)
tree6871a265a8dcf07c4e08a0fee79b4f3e5696bc4b /decoder/hg_io.cc
parent22e857a27ab9755b1f8655b0dcd94ac77cb790b8 (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.cc3
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_;
}
}