AnnotationIndex<AnnotationFS> index = resultCas.getAnnotationIndex(truePositiveType);
FSIterator<AnnotationFS> iter = index.iterator();
while (iter.isValid()) {
EvalAnnotation a = (EvalAnnotation) iter.next();
Annotation original = a.getOriginal();
Type originalType = original.getType();
if (map.containsKey(originalType.getName())) {
TypeEvalData element = (TypeEvalData) map.get(originalType.getName());
int oldCount = element.getTruePositives();
element.setTruePositives(oldCount + 1);
} else {
TypeEvalData newData = new TypeEvalData(originalType.getName(), 1, 0, 0);
map.put(originalType.getName(), newData);
}
}
index = resultCas.getAnnotationIndex(falsePositiveType);
iter = index.iterator();
while (iter.isValid()) {
EvalAnnotation a = (EvalAnnotation) iter.next();
Annotation original = a.getOriginal();
Type originalType = original.getType();
if (map.containsKey(originalType.getName())) {
TypeEvalData element = (TypeEvalData) map.get(originalType.getName());
int oldCount = element.getFalsePositives();
element.setFalsePositives(oldCount + 1);
} else {
TypeEvalData newData = new TypeEvalData(originalType.getName(), 0, 1, 0);
map.put(originalType.getName(), newData);
}
}
index = resultCas.getAnnotationIndex(falseNegativeType);
iter = index.iterator();
while (iter.isValid()) {
EvalAnnotation a = (EvalAnnotation) iter.next();
Annotation original = a.getOriginal();
Type originalType = original.getType();
if (map.containsKey(originalType.getName())) {
TypeEvalData element = (TypeEvalData) map.get(originalType.getName());
int oldCount = element.getFalseNegatives();