question: public static String ptb2Text ( String ptbText ) { StringBuffer sb = new StringBuffer ( ptbText . length ( ) ) ; PTB2TextLexer lexer = new PTB2TextLexer ( new StringReader ( ptbText ) ) ; String token ; try { while ( ( token = lexer . next ( ) ) != null ) sb . append ( token ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return ( sb . toString ( ) ) ; }
target:  Returns a presentable version of the given PTB-tokenized text. PTB tokenization splits up punctuation and does various other things that makes simply joining the tokens with spaces look bad. So join the tokens with space and run it through this method to produce nice looking text. It's not perfect, but it works pretty well.