if (top.label().value().startsWith("@") && !label.equals(top.label().value().substring(1))) {
return false;
}
if (top.children().length == 1) {
Tree child = top.children()[0];
if (child.children().length == 1) {
Tree grandChild = child.children()[0];
if (grandChild.children().length == 1) {
// Three consecutive unary trees. Not legal to keep adding unaries.
// TODO: do preterminals count in that equation?
return false;