From ee1520c5095ea8648617a3658b20eedfd4dd2007 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Mon, 18 Jun 2012 17:26:33 +0200 Subject: extract_rules cdec param --- decoder/viterbi.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'decoder/viterbi.cc') diff --git a/decoder/viterbi.cc b/decoder/viterbi.cc index 9d19914b..1b9c6665 100644 --- a/decoder/viterbi.cc +++ b/decoder/viterbi.cc @@ -5,11 +5,12 @@ #include #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) +std::string viterbi_stats(Hypergraph const& hg, std::string const& name, bool estring, bool etree,bool show_derivation, bool extract_rules, boost::shared_ptr extract_file) { ostringstream o; o << hg.stats(name); @@ -22,6 +23,9 @@ std::string viterbi_stats(Hypergraph const& hg, std::string const& name, bool es if (etree) { o<stream()); + } if (show_derivation) { o< edges; + Viterbi(hg, &edges); + for (unsigned i = 0; i < edges.size(); i++) + (*o) << edges[i]->rule_->AsString(true) << endl; +} string ViterbiETree(const Hypergraph& hg) { vector tmp; -- cgit v1.2.3