Skip to content

Commit c026e51

Browse files
committed
Add some doc
1 parent ff1ddfd commit c026e51

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/edu/stanford/nlp/parser/shiftreduce/BinaryTransition.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public boolean isLegal(State state, List<ParserConstraint> constraints) {
4646
if (ShiftReduceUtils.isTemporary(state.stack.peek()) && ShiftReduceUtils.isTemporary(state.stack.pop().peek())) {
4747
return false;
4848
}
49+
// If the first node on the stack is temporary, you can only make
50+
// right-headed binary transitions, and they must be to the same category
4951
if (ShiftReduceUtils.isTemporary(state.stack.peek())) {
5052
if (side == Side.LEFT) {
5153
return false;
@@ -54,6 +56,8 @@ public boolean isLegal(State state, List<ParserConstraint> constraints) {
5456
return false;
5557
}
5658
}
59+
// If the second node on the stack is temporary, you can only make
60+
// left-headed binary transitions, and they must be to the same category
5761
if (ShiftReduceUtils.isTemporary(state.stack.pop().peek())) {
5862
if (side == Side.RIGHT) {
5963
return false;

0 commit comments

Comments
 (0)