public static String convertBracketsToPTBFormat(String sentence){
  sentence=sentence.replaceAll("\\(","-LRB-");
  sentence=sentence.replaceAll("\\)","-RRB-");
  sentence=sentence.replaceAll("\\[","-LSB-");
  sentence=sentence.replaceAll("\\]","-RSB-");
  sentence=sentence.replaceAll("\\{","-LCB-");
  sentence=sentence.replaceAll("\\}","-RCB-");
  return sentence;
}

public static String convertBracketsToPTBFormat ( String sentence ) { sentence = sentence . replaceAll ( "\\(" , "-LRB-" ) ; sentence = sentence . replaceAll ( "\\)" , "-RRB-" ) ; sentence = sentence . replaceAll ( "\\[" , "-LSB-" ) ; sentence = sentence . replaceAll ( "\\]" , "-RSB-" ) ; sentence = sentence . replaceAll ( "\\{" , "-LCB-" ) ; sentence = sentence . replaceAll ( "\\}" , "-RCB-" ) ; return sentence ; }
convert brackets from readable forms to the penn treebank format ( which uses strings like - lrb - , - rrb - , etc to denote ' ( ' , ' ) ' , etc . )
