public boolean isAllNull(String aCasGroupId) { for (ICodingAnnotationItem item : study.getItems()) { if (item.getUnit(casGroupIds.indexOf(aCasGroupId)).getCategory() != null) { return false; } } return true; }
out.print(r + 1); for (ICodingAnnotationItem item : study.getItems()) out.print(DIVIDER + item.getUnit(r).getCategory()); out.println();
public int getNonNullCount(String aCasGroupId) { int i = 0; for (ICodingAnnotationItem item : study.getItems()) { if (item.getUnit(casGroupIds.indexOf(aCasGroupId)).getCategory() != null) { i++; } } return i; }
/** Returns a clone of the current annotation study which contains * only the annotation units of the raters with the given indexes. * All other units will be removed. This method is useful for * converting an annotation study with multiple raters into a * (pairwise) annotation study with two raters. */ public CodingAnnotationStudy extractRaters(final int... raters) { CodingAnnotationStudy result = new CodingAnnotationStudy(raters.length); for (ICodingAnnotationItem item : getItems()) { CodingAnnotationItem newItem = new CodingAnnotationItem(raters.length); for (int r = 0; r < raters.length; r++) { IAnnotationUnit unit = item.getUnit(raters[r]); newItem.addUnit(result.createUnit(result.items.size(), r, unit.getCategory())); } result.items.add(newItem); } return result; }
ICodingAnnotationItem item2 = agreement.getStudy().getItem(1); ICodingAnnotationItem item3 = agreement.getStudy().getItem(2); assertEquals("", item1.getUnit(0).getCategory()); assertEquals("", item1.getUnit(1).getCategory()); assertEquals("", item2.getUnit(0).getCategory()); assertEquals(null, item2.getUnit(1).getCategory()); assertEquals(null, item3.getUnit(0).getCategory()); assertEquals("", item3.getUnit(1).getCategory());