summaryrefslogtreecommitdiff
path: root/decoder/hg.cc
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/hg.cc')
-rw-r--r--decoder/hg.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/decoder/hg.cc b/decoder/hg.cc
index e456fa7c..46543b01 100644
--- a/decoder/hg.cc
+++ b/decoder/hg.cc
@@ -28,6 +28,13 @@ bool Hypergraph::AreNodesUniquelyIdentified() const {
return true;
}
+bool Hypergraph::ArePreGoalEdgesArity1() const {
+ auto& n = nodes_.back();
+ for (auto eid : n.in_edges_)
+ if (edges_[eid].Arity() != 1) return false;
+ return true;
+}
+
Hypergraph::Edge const* Hypergraph::ViterbiSortInEdges() {
NodeProbs nv;
ComputeNodeViterbi(&nv);