public static String render(Tree tree){
  StringBuilder sb=new StringBuilder();
  renderTree(tree,0,false,false,false,true,sb);
  sb.append('\n');
  return sb.toString();
}

public static String render ( Tree tree ) { StringBuilder sb = new StringBuilder ( ) ; renderTree ( tree , 0 , false , false , false , true , sb ) ; sb . append ( '\n' ) ; return sb . toString ( ) ; }
print the tree as done in penn treebank merged files . the formatting should be exactly the same , but we don ' t print the trailing whitespace found in penn treebank trees . the basic deviation from a bracketed indented tree is to in general collapse the printing of adjacent preterminals onto one line of tags and words . additional complexities are that conjunctions ( tag cc ) are not collapsed in this way , and that the unlabeled outer brackets are collapsed onto the same line as the next bracket down .
