public static void xmlPrint(Annotation annotation, OutputStream os, Options options) throws IOException { new XMLOutputter().print(annotation, os, options); }
public static void xmlPrint(Annotation annotation, OutputStream os) throws IOException { new XMLOutputter().print(annotation, os); }
public static void xmlPrint(Annotation annotation, OutputStream os, StanfordCoreNLP pipeline) throws IOException { new XMLOutputter().print(annotation, os, pipeline); }
/** Write this annotation as an XML string. * Optionally, you can also specify a number of operations to call on the document before * dumping it to XML. * This allows the user to ensure that certain annotations have been computed before the document * is dumped. * For example: * <p> * {@code String xml = new Document("Lucy in the sky with diamonds").xml(Document::parse, Document::ner); } * <p> * will create a XML dump of the document, ensuring that at least the parse tree and ner tags are populated. * * @param functions The (possibly empty) list of annotations to populate on the document before dumping it * to XML. * @return The XML String for this document. */ @SafeVarargs public final String xml(Function<Sentence, Object>... functions) { for (Function<Sentence, Object> f : functions) { f.apply(this.sentence(0)); } try { return new XMLOutputter().print(this.asAnnotation()); } catch (IOException e) { throw new RuntimeIOException(e); } }
/** * Like the {@link Document@xml(Function...)} function, but with minified XML more suitable * for sending over the wire. * * @param functions The (possibly empty) list of annotations to populate on the document before dumping it * to XML. * @return The XML String for this document, without unecessary whitespace. * */ @SafeVarargs public final String xmlMinified(Function<Sentence, Object>... functions) { for (Function<Sentence, Object> f : functions) { f.apply(this.sentence(0)); } try { AnnotationOutputter.Options options = new AnnotationOutputter.Options(false); return new XMLOutputter().print(this.asAnnotation(false), options); } catch (IOException e) { throw new RuntimeIOException(e); } }
switch (outputFormat) { case XML: new XMLOutputter().print(anno, System.out); break; case JSON:
public static void xmlPrint(Annotation annotation, OutputStream os, StanfordCoreNLP pipeline) throws IOException { new XMLOutputter().print(annotation, os, pipeline); }
public static void xmlPrint(Annotation annotation, OutputStream os) throws IOException { new XMLOutputter().print(annotation, os); }
public static void xmlPrint(Annotation annotation, OutputStream os, Options options) throws IOException { new XMLOutputter().print(annotation, os, options); }
/** Write this annotation as an XML string. * Optionally, you can also specify a number of operations to call on the document before * dumping it to XML. * This allows the user to ensure that certain annotations have been computed before the document * is dumped. * For example: * <p> * {@code String xml = new Document("Lucy in the sky with diamonds").xml(Document::parse, Document::ner); } * <p> * will create a XML dump of the document, ensuring that at least the parse tree and ner tags are populated. * * @param functions The (possibly empty) list of annotations to populate on the document before dumping it * to XML. * @return The XML String for this document. */ @SafeVarargs public final String xml(Function<Sentence, Object>... functions) { for (Function<Sentence, Object> f : functions) { f.apply(this.sentence(0)); } try { return new XMLOutputter().print(this.asAnnotation()); } catch (IOException e) { throw new RuntimeIOException(e); } }
/** * Like the {@link Document@xml(Function...)} function, but with minified XML more suitable * for sending over the wire. * * @param functions The (possibly empty) list of annotations to populate on the document before dumping it * to XML. * @return The XML String for this document, without unecessary whitespace. * */ @SafeVarargs public final String xmlMinified(Function<Sentence, Object>... functions) { for (Function<Sentence, Object> f : functions) { f.apply(this.sentence(0)); } try { AnnotationOutputter.Options options = new AnnotationOutputter.Options(false); return new XMLOutputter().print(this.asAnnotation(false), options); } catch (IOException e) { throw new RuntimeIOException(e); } }
switch (outputFormat) { case XML: new XMLOutputter().print(anno, System.out); break; case JSON: