diff options
author | Chris Dyer <redpony@gmail.com> | 2014-04-01 00:53:00 -0400 |
---|---|---|
committer | Chris Dyer <redpony@gmail.com> | 2014-04-01 00:53:00 -0400 |
commit | 6a3e80bb4b2a6bb10899183299d14fc070db1654 (patch) | |
tree | 22e4345f2dc67dd0fd4637e92d205ce59a90d3b3 /decoder | |
parent | 2999e2b3eac185bf3d0d3887576e94d3c11c9b46 (diff) |
tree2string test, fix for edge case
Diffstat (limited to 'decoder')
-rw-r--r-- | decoder/tree2string_translator.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/decoder/tree2string_translator.cc b/decoder/tree2string_translator.cc index 09eca147..7bc49132 100644 --- a/decoder/tree2string_translator.cc +++ b/decoder/tree2string_translator.cc @@ -167,6 +167,12 @@ struct Tree2StringTranslatorImpl { //cerr << "Goal node: " << goal << endl; hg.TopologicallySortNodesAndEdges(goal); hg.Reweight(weights); + + // there might be nodes that cannot be derived + // the following takes care of them + vector<bool> prune(hg.edges_.size(), false); + hg.PruneEdges(prune, true); + //hg.PrintGraphviz(); minus_lm_forest->swap(hg); return true; |