public List<KAFDocument> splitInSentences() { List<KAFDocument> sentNafs = new ArrayList<KAFDocument>(); Integer numParagraphs = this.getNumParagraphs(); for (Integer paragraph = 1; paragraph <= numParagraphs; paragraph++) { List<Integer> sentences = this.getSentsByParagraph(paragraph); for (Integer sentence : sentences) { KAFDocument naf = new KAFDocument(this.getLang(), this.getVersion()); naf.setRawText(this.getRawText()); for (AnnotationType type : highLevelAnnotationTypes) { Layer layer = highLevelAnnotationType2Layer.get(type); if (isSentenceLevelAnnotationType(type)) { List<Annotation> annotations = new ArrayList<Annotation>(); if (isMultiLayerAnnotationType(type)) { for (String groupId : annotationContainer.getGroupIDs(type)) { annotations.addAll(this.getBySent(type, groupId, sentence)); } } else { annotations = this.getBySent(type, sentence); } for (Annotation ann : annotations) { naf.addExistingAnnotation(ann, layer, type); } } } sentNafs.add(naf); } } return sentNafs; }