summaryrefslogtreecommitdiff
path: root/decoder/apply_models.cc
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-25 21:03:23 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-25 21:03:23 +0000
commit725ac32757ab6663933e649e8f7dc7052ff7c696 (patch)
tree91472016f2ebf8299f7129cd35b6abb3d7e9a6ba /decoder/apply_models.cc
parent7e54f38591ab2aaa0c9a8738425e7f388fec7a1d (diff)
USE_INFO_EDGE works for exh, cube
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@411 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/apply_models.cc')
-rw-r--r--decoder/apply_models.cc17
1 files changed, 5 insertions, 12 deletions
diff --git a/decoder/apply_models.cc b/decoder/apply_models.cc
index 77d35c92..700296da 100644
--- a/decoder/apply_models.cc
+++ b/decoder/apply_models.cc
@@ -204,13 +204,8 @@ public:
}
void IncorporateIntoPlusLMForest(Candidate* item, State2Node* s2n, CandidateList* freelist) {
- Hypergraph::Edge* new_edge = out.AddEdge(item->out_edge_.rule_, item->out_edge_.tail_nodes_);
- new_edge->feature_values_ = item->out_edge_.feature_values_;
+ Hypergraph::Edge* new_edge = out.AddEdge(item->out_edge_);
new_edge->edge_prob_ = item->out_edge_.edge_prob_;
- new_edge->i_ = item->out_edge_.i_;
- new_edge->j_ = item->out_edge_.j_;
- new_edge->prev_i_ = item->out_edge_.prev_i_;
- new_edge->prev_j_ = item->out_edge_.prev_j_;
Candidate*& o_item = (*s2n)[item->state_];
if (!o_item) o_item = item;
@@ -220,9 +215,12 @@ public:
node_states_.push_back(item->state_);
node_id = new_node->id_;
}
+#if 0
Hypergraph::Node* node = &out.nodes_[node_id];
out.ConnectEdgeToHeadNode(new_edge, node);
-
+#else
+ out.ConnectEdgeToHeadNode(new_edge, node_id);
+#endif
// update candidate if we have a better derivation
// note: the difference between the vit score and the estimated
// score is the same for all items with a common residual DP
@@ -337,11 +335,6 @@ struct NoPruningRescorer {
for (int i = 0; i < arity; ++i)
tail[i] = nodemap[in_edge.tail_nodes_[i]][tail_iter[i]];
Hypergraph::Edge* new_edge = out.AddEdge(in_edge, tail);
- new_edge->feature_values_ = in_edge.feature_values_;
- new_edge->i_ = in_edge.i_;
- new_edge->j_ = in_edge.j_;
- new_edge->prev_i_ = in_edge.prev_i_;
- new_edge->prev_j_ = in_edge.prev_j_;
string head_state;
if (is_goal) {
assert(tail.size() == 1);