summaryrefslogtreecommitdiff
path: root/decoder/hg.cc
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/hg.cc')
-rw-r--r--decoder/hg.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/decoder/hg.cc b/decoder/hg.cc
index 025feb7c..4da0beb3 100644
--- a/decoder/hg.cc
+++ b/decoder/hg.cc
@@ -6,6 +6,7 @@
#include <set>
#include <map>
#include <iostream>
+#include <sstream>
#include "viterbi.h"
#include "inside_outside.h"
@@ -13,6 +14,15 @@
using namespace std;
+std::string Hypergraph::stats(std::string const& name) const
+{
+ ostringstream o;
+ o<<name<<" (nodes/edges): "<<nodes_.size()<<'/'<<edges_.size()<<endl;
+ o<<name<<" (paths): "<<NumberOfPaths()<<endl;
+ return o.str();
+}
+
+
double Hypergraph::NumberOfPaths() const {
return Inside<double, TransitionCountWeightFunction>(*this);
}