private AnnotatedText getAnnotatedText(String sentence, int[] footnotePos, ProofreadingResult paRes) {
Set<Integer> correctedPos = new HashSet<>();
for (int pos : footnotePos) {
correctedPos.add(pos - paRes.nStartOfSentencePosition);
}
AnnotatedTextBuilder annotations = new AnnotatedTextBuilder();
// not very efficient but simple implementation:
for (int i = 0; i < sentence.length(); i++) {
if (correctedPos.contains(i)) {
annotations.addMarkup("\u200B");
} else {
annotations.addText(String.valueOf(sentence.charAt(i)));
}
}
return annotations.build();
}