diff options
author | Chris Dyer <redpony@gmail.com> | 2014-05-08 20:23:42 -0400 |
---|---|---|
committer | Chris Dyer <redpony@gmail.com> | 2014-05-08 20:23:42 -0400 |
commit | 6d3490279cace80e202f277f9f3214edd09da8ad (patch) | |
tree | 7ada55543a45ea3b52b3dc3405db12b64555fc03 /decoder/tree2string_translator.cc | |
parent | aa9d5d402c01e45835878c02777442950a0f6c0a (diff) | |
parent | 3cec93d6df6190c486fc57dfe25661b24d9fa75e (diff) |
Merge branch 'master' of https://github.com/redpony/cdec
Diffstat (limited to 'decoder/tree2string_translator.cc')
-rw-r--r-- | decoder/tree2string_translator.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/decoder/tree2string_translator.cc b/decoder/tree2string_translator.cc index c353f7ca..fafb0d97 100644 --- a/decoder/tree2string_translator.cc +++ b/decoder/tree2string_translator.cc @@ -128,12 +128,14 @@ namespace std { void AddDummyGoalNode(Hypergraph* hg) { static const int kGOAL = -TD::Convert("Goal"); - static TRulePtr kGOAL_RULE(new TRule("[Goal] ||| [X] ||| [1]")); unsigned old_goal_node_idx = hg->nodes_.size() - 1; + int old_goal_cat = hg->nodes_[old_goal_node_idx].cat_; + TRulePtr goal_rule(new TRule("[Goal] ||| [X] ||| [1]")); + goal_rule->f_[0] = old_goal_cat; HG::Node* goal_node = hg->AddNode(kGOAL); goal_node->node_hash = 1; TailNodeVector tail(1, old_goal_node_idx); - HG::Edge* new_edge = hg->AddEdge(kGOAL_RULE, tail); + HG::Edge* new_edge = hg->AddEdge(goal_rule, tail); hg->ConnectEdgeToHeadNode(new_edge, goal_node); } |