use of edu.stanford.nlp.io.StringOutputStream in project CoreNLP by stanfordnlp.
the class CharniakScoredParsesReaderWriter method parsesToString.
/**
* Convert list of scored parse trees to string representing scored parses
* (in the charniak parser output format)
* @param parses - list of scored parse trees
* @return string representing scored parses
*/
public String parsesToString(List<ScoredObject<Tree>> parses) {
if (parses == null)
return null;
StringOutputStream os = new StringOutputStream();
PrintWriter pw = new PrintWriter(os);
printScoredTrees(pw, 0, parses);
pw.close();
return os.toString();
}
Aggregations