summaryrefslogtreecommitdiff
path: root/decoder/tree2string_translator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/tree2string_translator.cc')
-rw-r--r--decoder/tree2string_translator.cc6
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;