summaryrefslogtreecommitdiff
path: root/decoder/hg.cc
diff options
context:
space:
mode:
authorgraehl@gmail.com <graehl@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-08 08:49:13 +0000
committergraehl@gmail.com <graehl@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-08 08:49:13 +0000
commitffd4acfe5b84f413c66af6ec5a76bdbc0d3aa9e8 (patch)
treee5e6f9063e200a7bee863fa34557007d5271a22f /decoder/hg.cc
parentb588990fe985be78c05a9497d7f95b440d454cd3 (diff)
cfg
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@493 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/hg.cc')
-rw-r--r--decoder/hg.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/decoder/hg.cc b/decoder/hg.cc
index f0238fe3..47924d99 100644
--- a/decoder/hg.cc
+++ b/decoder/hg.cc
@@ -147,10 +147,21 @@ struct vpusher : public vector<TropicalValue> {
};
}
-void Hypergraph::PushViterbiWeightsToGoal(int fid) {
+prob_t Hypergraph::ComputeNodeViterbi(NodeProbs *np) const
+{
+ return Inside(*this,
+ reinterpret_cast<std::vector<TropicalValue> *>(np),
+ ViterbiWeightFunction()).v_;
+}
+
+
+// save pushed weight ot some fid if we want. 0 = don't care
+prob_t Hypergraph::PushViterbiWeightsToGoal(int fid) {
vpusher vi(fid);
- Inside(*this,&vi,ViterbiWeightFunction());
+ NodeProbs np;
+ prob_t r=ComputeNodeViterbi(&np);
visit_edges(vi);
+ return r;
}