Package edu.stanford.nlp.io

Examples of edu.stanford.nlp.io.StringOutputStream


  }

  public static String getConllEvalSummary(String conllMentionEvalScript,
      String goldFile, String predictFile) throws IOException {
    ProcessBuilder process = new ProcessBuilder(conllMentionEvalScript, "all", goldFile, predictFile, "none");
    StringOutputStream errSos = new StringOutputStream();
    StringOutputStream outSos = new StringOutputStream();
    PrintWriter out = new PrintWriter(outSos);
    PrintWriter err = new PrintWriter(errSos);
    SystemUtils.run(process, out, err);
    out.close();
    err.close();
    String summary = outSos.toString();
    String errStr = errSos.toString();
    if ( ! errStr.isEmpty()) {
      summary += "\nERROR: " + errStr;
    }
    Pattern pattern = Pattern.compile("\\d+\\.\\d\\d\\d+");
View Full Code Here


*/
public class XMLUtils {
  private static Document document = createDocument();

  public static String documentToString(Document document) {
    StringOutputStream s = new StringOutputStream();
    printNode(s, document, true, true);
    return s.toString();
  }
View Full Code Here

    printNode(s, document, true, true);
    return s.toString();
  }

  public static String nodeToString(Node node, boolean prettyPrint) {
    StringOutputStream s = new StringOutputStream();
    printNode(s, node, prettyPrint, false);
    return s.toString();
  }
View Full Code Here

   * @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();
  }
View Full Code Here

TOP

Related Classes of edu.stanford.nlp.io.StringOutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.