summaryrefslogtreecommitdiff
path: root/decoder/lexcrf.cc
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2009-12-19 14:32:28 -0500
committerChris Dyer <redpony@gmail.com>2009-12-19 14:32:28 -0500
commit27db9d8c05188f64c17d61c394d3dafe8b8e93d8 (patch)
tree688930b6e95b6801ffe7d722f33a4f56712ecd21 /decoder/lexcrf.cc
parent39b9c1e0aaec81492d81e541daf7703ba8c517ff (diff)
cool new alignment feature
Diffstat (limited to 'decoder/lexcrf.cc')
-rw-r--r--decoder/lexcrf.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/decoder/lexcrf.cc b/decoder/lexcrf.cc
index 9f96de9f..b80d055c 100644
--- a/decoder/lexcrf.cc
+++ b/decoder/lexcrf.cc
@@ -46,7 +46,7 @@ struct LexicalCRFImpl {
// hack to tell the feature function system how big the sentence pair is
const int f_start = (use_null ? -1 : 0);
int prev_node_id = -1;
- for (int i = 0; i < e_len; ++i) { // for each word in the *ref*
+ for (int i = 0; i < e_len; ++i) { // for each word in the *target*
Hypergraph::Node* node = forest->AddNode(kXCAT);
const int new_node_id = node->id_;
for (int j = f_start; j < f_len; ++j) { // for each word in the source
@@ -73,8 +73,8 @@ struct LexicalCRFImpl {
const int comb_node_id = forest->AddNode(kXCAT)->id_;
Hypergraph::TailNodeVector tail(2, prev_node_id);
tail[1] = new_node_id;
- const int edge_id = forest->AddEdge(kBINARY, tail)->id_;
- forest->ConnectEdgeToHeadNode(edge_id, comb_node_id);
+ Hypergraph::Edge* edge = forest->AddEdge(kBINARY, tail);
+ forest->ConnectEdgeToHeadNode(edge->id_, comb_node_id);
prev_node_id = comb_node_id;
} else {
prev_node_id = new_node_id;