summaryrefslogtreecommitdiff
path: root/decoder/decoder.cc
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2014-04-07 22:56:34 -0400
committerChris Dyer <redpony@gmail.com>2014-04-07 22:56:34 -0400
commit5a8b0aa3245f14a3c049f6f8d34c3a6f37cf070c (patch)
tree2117a9eca8065e9eed33251a4ac12ebc875fae9f /decoder/decoder.cc
parent8c77c634836e56c7b9b3400afeac21277f168238 (diff)
track node state for smarter union
Diffstat (limited to 'decoder/decoder.cc')
-rw-r--r--decoder/decoder.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/decoder/decoder.cc b/decoder/decoder.cc
index 43e2640d..354ea2d9 100644
--- a/decoder/decoder.cc
+++ b/decoder/decoder.cc
@@ -750,6 +750,11 @@ bool DecoderImpl::Decode(const string& input, DecoderObserver* o) {
return false;
}
+ // this is mainly used for debugging, eventually this will be an assertion
+ if (!forest.AreNodesUniquelyIdentified()) {
+ if (!SILENT) cerr << " *** NODES NOT UNIQUELY IDENTIFIED ***\n";
+ }
+
const bool show_tree_structure=conf.count("show_tree_structure");
if (!SILENT) forest_stats(forest," Init. forest",show_tree_structure,oracle.show_derivation);
if (conf.count("show_expected_length")) {
@@ -813,6 +818,10 @@ bool DecoderImpl::Decode(const string& input, DecoderObserver* o) {
forest.swap(rescored_forest);
forest.Reweight(cur_weights);
if (!SILENT) forest_stats(forest," " + passtr +" forest",show_tree_structure,oracle.show_derivation, conf.count("extract_rules"), extract_file);
+ // this is mainly used for debugging, eventually this will be an assertion
+ if (!forest.AreNodesUniquelyIdentified()) {
+ if (!SILENT) cerr << " *** NODES NOT UNIQUELY IDENTIFIED ***\n";
+ }
}
if (conf.count("show_partition")) {
@@ -984,6 +993,10 @@ bool DecoderImpl::Decode(const string& input, DecoderObserver* o) {
forest.edges_[i].rule_ = forest.edges_[i].rule_->parent_rule_;
}
forest.Reweight(last_weights);
+ // this is mainly used for debugging, eventually this will be an assertion
+ if (!forest.AreNodesUniquelyIdentified()) {
+ if (!SILENT) cerr << " *** NODES NOT UNIQUELY IDENTIFIED ***\n";
+ }
if (!SILENT) forest_stats(forest," Constr. forest",show_tree_structure,oracle.show_derivation);
if (!SILENT) cerr << " Constr. VitTree: " << ViterbiFTree(forest) << endl;
if (conf.count("show_partition")) {