use of nu.xom.Nodes in project CoreNLP by stanfordnlp.
the class CoreNLPServlet method outputPretty.
public void outputPretty(PrintWriter out, Annotation annotation) throws ServletException {
try {
Document input = XMLOutputter.annotationToDoc(annotation, pipeline);
Nodes output = corenlpTransformer.transform(input);
for (int i = 0; i < output.size(); i++) {
out.print(output.get(i).toXML());
}
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new ServletException(e);
}
}
Aggregations