summaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2014-04-01 18:49:22 -0400
committerChris Dyer <redpony@gmail.com>2014-04-01 18:49:22 -0400
commit4025e1cdd57ac678eab2f10deceeaa2a04549144 (patch)
tree7d20218ab195d8c6df44c97699d2ae087f91b4d7 /decoder
parent241a9932588563f7952f7d758e3f77d8c499443c (diff)
deal with multiple grammars in t2s
Diffstat (limited to 'decoder')
-rw-r--r--decoder/tree_fragment.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/decoder/tree_fragment.h b/decoder/tree_fragment.h
index ceb7fa60..f1c4c106 100644
--- a/decoder/tree_fragment.h
+++ b/decoder/tree_fragment.h
@@ -139,6 +139,10 @@ class BreadthFirstIterator : public std::iterator<std::forward_iterator_tag, uns
q_.pop_back();
return *this;
}
+ unsigned child_node() const {
+ assert(IsRHS(sym));
+ return q_.back().node;
+ }
BreadthFirstIterator remainder() const {
assert(IsRHS(sym));
return BreadthFirstIterator(tf_, q_.back());