// lexical leaves do not add any Constituents
// but increment position
// System.err.println("In bracketing trees leaf is " + label());
CyclicCoreLabel l = (CyclicCoreLabel) label();
l.set(SpanAnnotation.class, new IntPair(left, left));
return (left + 1);
}
int position = left;
// System.err.println("In bracketing trees left is " + left);
// System.err.println(" label is " + label() +
// "; num daughters: " + children().length);
// enumerate through daughter trees
Tree[] kids = children();
for (int i = 0; i < kids.length; i++) {
// compute bracketings for daughter tree
// update position to end of daughter tree
position = kids[i].constituentsNodes(position);
// System.err.println(" position went to " + position);
}
// need to wait until result position is known in order to
// calculate span of whole tree
CyclicCoreLabel l = (CyclicCoreLabel) label();
l.set(SpanAnnotation.class, new IntPair(left, position - 1));
return position;
}