Search in sources :

Example 1 with Tsv3XSerializer

use of de.tudarmstadt.ukp.clarin.webanno.tsv.internal.tsv3x.Tsv3XSerializer in project webanno by webanno.

the class WebannoTsv3XWriter method process.

@Override
public void process(JCas aJCas) throws AnalysisEngineProcessException {
    TsvSchema schema = Tsv3XCasSchemaAnalyzer.analyze(aJCas.getTypeSystem());
    TsvDocument doc = Tsv3XCasDocumentBuilder.of(schema, aJCas);
    try (PrintWriter docOS = new PrintWriter(new OutputStreamWriter(getOutputStream(aJCas, filenameSuffix), encoding))) {
        new Tsv3XSerializer().write(docOS, doc);
    } catch (IOException e) {
        throw new AnalysisEngineProcessException(e);
    }
}
Also used : TsvDocument(de.tudarmstadt.ukp.clarin.webanno.tsv.internal.tsv3x.model.TsvDocument) TsvSchema(de.tudarmstadt.ukp.clarin.webanno.tsv.internal.tsv3x.model.TsvSchema) OutputStreamWriter(java.io.OutputStreamWriter) Tsv3XSerializer(de.tudarmstadt.ukp.clarin.webanno.tsv.internal.tsv3x.Tsv3XSerializer) IOException(java.io.IOException) AnalysisEngineProcessException(org.apache.uima.analysis_engine.AnalysisEngineProcessException) PrintWriter(java.io.PrintWriter)

Aggregations

Tsv3XSerializer (de.tudarmstadt.ukp.clarin.webanno.tsv.internal.tsv3x.Tsv3XSerializer)1 TsvDocument (de.tudarmstadt.ukp.clarin.webanno.tsv.internal.tsv3x.model.TsvDocument)1 TsvSchema (de.tudarmstadt.ukp.clarin.webanno.tsv.internal.tsv3x.model.TsvSchema)1 IOException (java.io.IOException)1 OutputStreamWriter (java.io.OutputStreamWriter)1 PrintWriter (java.io.PrintWriter)1 AnalysisEngineProcessException (org.apache.uima.analysis_engine.AnalysisEngineProcessException)1