use of de.tudarmstadt.ukp.clarin.webanno.tsv.internal.tsv3x.model.TsvColumn in project webanno by webanno.
the class Tsv3XSerializer method write.
public void write(PrintWriter aOut, TsvUnit aUnit) {
TsvDocument doc = aUnit.getDocument();
// Write unit ID
aOut.print(aUnit.getId());
aOut.print(FIELD_SEPARATOR);
// Write unit offset
aOut.printf("%d-%d", aUnit.getBegin(), aUnit.getEnd());
aOut.print(FIELD_SEPARATOR);
// Write unit text
aOut.print(doc.getJCas().getDocumentText().substring(aUnit.getBegin(), aUnit.getEnd()));
aOut.printf(FIELD_SEPARATOR);
// Write the remaining columns according to the schema definition
for (TsvColumn col : doc.getSchema().getHeaderColumns(doc.getActiveColumns())) {
// Write all the values in this column - there could be multiple due to stacking
writeValues(aOut, aUnit, col);
aOut.printf(FIELD_SEPARATOR);
}
}
Aggregations