summaryrefslogtreecommitdiff
path: root/decoder/viterbi.h
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-01 23:08:34 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-01 23:08:34 +0000
commitf6994142f7b6a874e8fb62fa279816d8d6e9eab1 (patch)
tree5f0b3d115b66dc610aaa5cba2cef1d0944c49e37 /decoder/viterbi.h
parentc909f7c76d07886a67f511a11baa510fd3c5fb3f (diff)
factor forest stats (show size post pruning, and portion kept) and cdec --scale_prune_srclen
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@96 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/viterbi.h')
-rw-r--r--decoder/viterbi.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/decoder/viterbi.h b/decoder/viterbi.h
index dd54752a..d4a97516 100644
--- a/decoder/viterbi.h
+++ b/decoder/viterbi.h
@@ -6,6 +6,8 @@
#include "hg.h"
#include "tdict.h"
+std::string viterbi_stats(Hypergraph const& hg, std::string const& name="forest", bool estring=true, bool etree=false);
+
// V must implement:
// void operator()(const vector<const T*>& ants, T* result);
template<typename T, typename Traversal, typename WeightType, typename WeightFunction>
@@ -21,7 +23,7 @@ WeightType Viterbi(const Hypergraph& hg,
const Hypergraph::Node& cur_node = hg.nodes_[i];
WeightType* const cur_node_best_weight = &vit_weight[i];
T* const cur_node_best_result = &vit_result[i];
-
+
const int num_in_edges = cur_node.in_edges_.size();
if (num_in_edges == 0) {
*cur_node_best_weight = WeightType(1);