summaryrefslogtreecommitdiff
path: root/decoder/viterbi.cc
diff options
context:
space:
mode:
authorgraehl@gmail.com <graehl@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-09 06:14:04 +0000
committergraehl@gmail.com <graehl@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-09 06:14:04 +0000
commitb96f8ca79c3293062a4b24266e07859cedc936c2 (patch)
treeef81550fb137d536f8ae64733d9da73be2417078 /decoder/viterbi.cc
parentffd4acfe5b84f413c66af6ec5a76bdbc0d3aa9e8 (diff)
hg sort in_edges by viterbi, debug print temporarily enabled which always --show_derivation
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@494 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/viterbi.cc')
-rw-r--r--decoder/viterbi.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/decoder/viterbi.cc b/decoder/viterbi.cc
index b21139df..6bcc97db 100644
--- a/decoder/viterbi.cc
+++ b/decoder/viterbi.cc
@@ -5,6 +5,8 @@
#include <vector>
#include "hg.h"
+#define DEBUG_VITERBI_SORT
+
using namespace std;
std::string viterbi_stats(Hypergraph const& hg, std::string const& name, bool estring, bool etree,bool show_derivation)
@@ -25,7 +27,12 @@ std::string viterbi_stats(Hypergraph const& hg, std::string const& name, bool es
o << hg.show_viterbi_tree(false); // last item should be goal (or at least depend on prev items). TODO: this doesn't actually reorder the nodes in hg.
o<<endl;
}
-
+#ifdef DEBUG_VITERBI_SORT
+ const_cast<Hypergraph&>(hg).ViterbiSortInEdges();
+ o<<name<<" (viterbi sort) first derivation: ";
+ o<<hg.show_first_tree(false);
+ o<<endl;
+#endif
return o.str();
}