summaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2014-04-01 00:53:00 -0400
committerChris Dyer <redpony@gmail.com>2014-04-01 00:53:00 -0400
commit17c8e9a7ef19fbd3158efc6fd40313ce7ca5273f (patch)
tree6de25609eb77d946ba11abf09bc9451dc0c28281 /decoder
parent403c81d11ee572cc9c2d7fd7ebe8ab08691693a5 (diff)
tree2string test, fix for edge case
Diffstat (limited to 'decoder')
-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;