Revision 2872

tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/AnnotationWriter.java (revision 2872)
4 4
import java.io.IOException;
5 5
import java.util.ArrayList;
6 6
import java.util.Arrays;
7
import java.util.Comparator;
7 8
import java.util.HashMap;
8 9
import java.util.List;
9 10
import java.util.logging.Level;
......
177 178
		textAnnotations = new ArrayList<Annotation>();
178 179
		annotationsPerTexts.put(textsIds.get(currentText), textAnnotations);
179 180
		
181
		allCorpusAnnotations.sort(new Comparator<Annotation>() {
182
			@Override
183
			public int compare(Annotation arg0, Annotation arg1) {
184
				int r = arg0.getStart() - arg1.getStart();
185
				if (r == 0) {
186
					return arg0.getEnd() - arg1.getEnd();
187
				} else {
188
					return r;
189
				}
190
			}
191
		});
192
		
180 193
		// group annotations per text
181 194
		for (Annotation currentAnnot : allCorpusAnnotations) { // parse all annotations
182 195
			// System.out.println(" Annotation: "+currentAnnot);

Also available in: Unified diff