Example usage for edu.stanford.nlp.io IOUtils encodedOutputStreamPrintWriter

List of usage examples for edu.stanford.nlp.io IOUtils encodedOutputStreamPrintWriter

Introduction

In this page you can find the example usage for edu.stanford.nlp.io IOUtils encodedOutputStreamPrintWriter.

Prototype

public static PrintWriter encodedOutputStreamPrintWriter(OutputStream stream, String encoding,
        boolean autoFlush) throws IOException 

Source Link

Document

Create a Reader with an explicit encoding around an InputStream.

Usage

From source file:lv.lumii.ner.NerPipe.java

License:Open Source License

public void writeAnswers(List<CoreLabel> doc) {
    try {//from   w  w w  .  j a v a 2 s .  c o m
        classifier.writeAnswers(doc, IOUtils.encodedOutputStreamPrintWriter(System.out, "utf-8", true),
                defaultReaderWriter);
    } catch (IOException e) {
        e.printStackTrace();
    }
}

From source file:lv.lumii.ner.NerPipe.java

License:Open Source License

public void writeAnswers(List<CoreLabel> doc, DocumentReaderAndWriter<CoreLabel> writer) {
    try {/* ww  w.ja v  a2 s .  c o  m*/
        classifier.writeAnswers(doc, IOUtils.encodedOutputStreamPrintWriter(System.out, "utf-8", true), writer);
    } catch (IOException e) {
        e.printStackTrace();
    }
}

From source file:lv.lumii.ner.NerPipe.java

License:Open Source License

public void writeAnswers(ObjectBank<List<CoreLabel>> documents, DocumentReaderAndWriter<CoreLabel> writer) {
    try {//from ww w.  ja  v a2s .co m
        for (List<CoreLabel> doc : documents) {
            classifier.writeAnswers(doc, IOUtils.encodedOutputStreamPrintWriter(System.out, "utf-8", true),
                    writer);
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
}