p.format("=== \"%s\" BEGIN [%d] ===%n", label, targetAnnotation.getAddress()); String highlightIfMatching = currentAddress.equals(targetAnnotation.getAddress()) ? "###" : ""; p.format("ANNOTATION: address: %d %s%n", currentAddress, highlightIfMatching); T currentAnnotation = mapByAddress.get(currentAddress); p.format("=== \"%s\" END [%d] ===%n", label, targetAnnotation.getAddress());
p.format("=== \"%s\" BEGIN [%d] ===%n", label, targetAnnotation.getAddress()); String highlightIfMatching = currentAddress.equals(targetAnnotation.getAddress()) ? "###" : ""; p.format("ANNOTATION: address: %d %s%n", currentAddress, highlightIfMatching); T currentAnnotation = mapByAddress.get(currentAddress); p.format("=== \"%s\" END [%d] ===%n", label, targetAnnotation.getAddress());
public void initialize() { AnnotationIndex<Annotation> annotationIndex = null; if (targetType == null) { annotationIndex = jcas.getAnnotationIndex(); } else { annotationIndex = jcas.getAnnotationIndex(targetType); } mapByAddress = new HashMap<Integer, T>(); //logger.info(" before iterating over all annotations in index..."); for (Annotation annotation : annotationIndex) { //logger.info(" begin single annotation"); Integer address = annotation.getAddress(); //logger.info(String.format(" address: %d; type: %s", address, annotation.getClass().getName())); T current = (T)annotation; mapByAddress.put(address, current); //logger.info(" end single annotation"); } //logger.info(" after iterating over all annotations in index..."); }
public void initialize() { AnnotationIndex<Annotation> annotationIndex = null; if (targetType == null) { annotationIndex = jcas.getAnnotationIndex(); } else { annotationIndex = jcas.getAnnotationIndex(targetType); } mapByAddress = new HashMap<Integer, T>(); //logger.info(" before iterating over all annotations in index..."); for (Annotation annotation : annotationIndex) { //logger.info(" begin single annotation"); Integer address = annotation.getAddress(); //logger.info(String.format(" address: %d; type: %s", address, annotation.getClass().getName())); T current = (T)annotation; mapByAddress.put(address, current); //logger.info(" end single annotation"); } //logger.info(" after iterating over all annotations in index..."); }
public Map<Integer, Annotation> generateAnnotationMap(JCas jcas, Integer typeId) { Map<Integer, Annotation> annotationMap = new HashMap<Integer, Annotation>(); AnnotationIndex<Annotation> index = null; if (typeId == null) { index = jcas.getAnnotationIndex(); } else { index = jcas.getAnnotationIndex(typeId); } FSIterator<Annotation> iterator = index.iterator(); while (iterator.hasNext()) { Annotation current = iterator.next(); int address = current.getAddress(); annotationMap.put(address, current); } return annotationMap; }
public Map<Integer, Annotation> generateAnnotationMap(JCas jcas, Integer typeId) { Map<Integer, Annotation> annotationMap = new HashMap<Integer, Annotation>(); AnnotationIndex<Annotation> index = null; if (typeId == null) { index = jcas.getAnnotationIndex(); } else { index = jcas.getAnnotationIndex(typeId); } FSIterator<Annotation> iterator = index.iterator(); while (iterator.hasNext()) { Annotation current = iterator.next(); int address = current.getAddress(); annotationMap.put(address, current); } return annotationMap; }
prunedKeepIndex.add(a.getAddress()); if (prunedKeepIndex.contains(a.getAddress())) { Keep keep = new Keep(jCas, a.getBegin(), a.getEnd()); keep.setEnclosedAnnot(a);
if (curAnno.getAddress() == ((Annotation) refFS).getAddress()) { aDestFS.setFeatureValue(destFeat, copyFs(curAnno)); foundexisting = true;