/** * Add a new annotation, which is merged from the old annotations, removing the old annotations. * * @param newAnnotation The annotation which is to be added to the document as the merged result * of the old annotations * @param annotations Annotation(s) which have been merged and should be removed */ public void mergeWithNew(Annotation newAnnotation, Annotation... annotations) { mergeWithNew(newAnnotation, Arrays.asList(annotations)); }
/** * Add a new annotation, which is merged from the old annotations, removing the old annotations. * * @param newAnnotation The annotation which is to be added to the document as the merged result * of the old annotations * @param annotations Annotation(s) which have been merged and should be removed */ public void mergeWithNew(Annotation newAnnotation, Annotation... annotations) { mergeWithNew(newAnnotation, Arrays.asList(annotations)); }
/** * Add a new annotation, which is merged from the old annotations, removing the old annotations. * * @param newAnnotation The annotation which is to be added to the document as the merged result * of the old annotations * @param annotations Annotation(s) which have been merged and should be removed */ protected void mergeWithNew( Annotation newAnnotation, Collection<? extends Annotation> annotations) { getSupport().mergeWithNew(newAnnotation, annotations); }
/** * Add a new annotation, which is merged from the old annotations, removing the old annotations. * * @param newAnnotation The annotation which is to be added to the document as the merged result * of the old annotations * @param annotations Annotation(s) which have been merged and should be removed */ protected void mergeWithNew( Annotation newAnnotation, Collection<? extends Annotation> annotations) { getSupport().mergeWithNew(newAnnotation, annotations); }
/** * Add a new annotation, which is merged from the old annotations, removing the old annotations. * * @param newAnnotation The annotation which is to be added to the document as the merged result * of the old annotations * @param annotations Annotation(s) which have been merged and should be removed */ protected void mergeWithNew(Annotation newAnnotation, Annotation... annotations) { getSupport().mergeWithNew(newAnnotation, annotations); }
/** * Add a new annotation, which is merged from the old annotations, removing the old annotations. * * @param newAnnotation The annotation which is to be added to the document as the merged result * of the old annotations * @param annotations Annotation(s) which have been merged and should be removed */ protected void mergeWithNew(Annotation newAnnotation, Annotation... annotations) { getSupport().mergeWithNew(newAnnotation, annotations); }
@Test public void testMergeWithNewAnnotationAnnotationArray() { UimaSupport support = new UimaSupport(PIPELINE, UimaSupportTest.class, history, monitor, false); Location l = new Location(jCas); l.setBegin(0); l.setEnd(0); Metadata md2 = new Metadata(jCas); md2.setBegin(0); md2.setEnd(0); support.mergeWithNew(l, location); support.mergeWithNew(md2, md); List<Location> locations = new ArrayList<>(JCasUtil.select(jCas, Location.class)); List<Metadata> mds = new ArrayList<>(JCasUtil.select(jCas, Metadata.class)); assertEquals(1, locations.size()); assertEquals(l, locations.get(0)); assertEquals(1, mds.size()); assertEquals(md2, mds.get(0)); assertFalse(support.getDocumentHistory(jCas).getHistory(l.getInternalId()).isEmpty()); }
verify(support, only()).mergeWithNew(existingAnnotation, annotation); resetMocked(); verify(support, only()).mergeWithNew(existingAnnotation, list); resetMocked();