use of de.tudarmstadt.ukp.clarin.webanno.api.annotation.paging.Unit in project webanno by webanno.
the class BratRenderer method renderUnitsAsRows.
public static void renderUnitsAsRows(GetDocumentResponse aResponse, AnnotatorState aState) {
int windowBegin = aState.getWindowBeginOffset();
aResponse.setSentenceNumberOffset(aState.getFirstVisibleUnitIndex());
// Render sentences
int sentIdx = aResponse.getSentenceNumberOffset();
for (Unit unit : aState.getVisibleUnits()) {
aResponse.addSentence(unit.getBegin() - windowBegin, unit.getEnd() - windowBegin);
// comment.
if (isNotBlank(unit.getId())) {
aResponse.addComment(new SentenceComment(sentIdx, Comment.ANNOTATOR_NOTES, String.format("Sentence ID: %s", unit.getId())));
}
sentIdx++;
}
}
Aggregations