/** * Merge annotations whilst ignoring coreferences. It is recommended that mergeWithExisting(...) * is used instead as that will pass off to this method when appropriate * * @param existingAnnotation The annotation which is to be left in the document (merged) * @param annotations Annotation(s) which will be merged with existingAnnotation and then removed */ public void mergeWithExistingNoCoref( Annotation existingAnnotation, Collection<? extends Annotation> annotations) { for (Annotation a : annotations) { addMergeToHistory(existingAnnotation, a); } remove(annotations); }
/** * Merge annotations whilst ignoring coreferences. It is recommended that mergeWithExisting(...) * is used instead as that will pass off to this method when appropriate * * @param existingAnnotation The annotation which is to be left in the document (merged) * @param annotations Annotation(s) which will be merged with existingAnnotation and then removed */ public void mergeWithExistingNoCoref( Annotation existingAnnotation, Collection<? extends Annotation> annotations) { for (Annotation a : annotations) { addMergeToHistory(existingAnnotation, a); } remove(annotations); }
/** * Merge entity onto targetEntity (assuming they have the same ReferentTarget), updating * relationships as required. * * @return True if merge was successful, false otherwise */ private boolean mergeEntities(Entity entity, Entity targetEntity) { ReferenceTarget targetRef = targetEntity.getReferent(); ReferenceTarget entityRef = entity.getReferent(); if (mergeDistinctEntities || isSameTarget(targetRef, entityRef)) { addMergeToHistory(targetEntity, entity); // Update relationship pointers for (Relation r : getRelations(entity)) { if (r.getSource() == entity) { r.setSource(targetEntity); } if (r.getTarget() == entity) { r.setTarget(targetEntity); } } remove(entity); return true; } else { monitor.debug( "Not merging objects {} and {} as they have different referents", targetEntity.getInternalId(), entity.getInternalId()); return false; } }
/** * Merge entity onto targetEntity (assuming they have the same ReferentTarget), updating * relationships as required. * * @return True if merge was successful, false otherwise */ private boolean mergeEntities(Entity entity, Entity targetEntity) { ReferenceTarget targetRef = targetEntity.getReferent(); ReferenceTarget entityRef = entity.getReferent(); if (mergeDistinctEntities || isSameTarget(targetRef, entityRef)) { addMergeToHistory(targetEntity, entity); // Update relationship pointers for (Relation r : getRelations(entity)) { if (r.getSource() == entity) { r.setSource(targetEntity); } if (r.getTarget() == entity) { r.setTarget(targetEntity); } } remove(entity); return true; } else { monitor.debug( "Not merging objects {} and {} as they have different referents", targetEntity.getInternalId(), entity.getInternalId()); return false; } }