gate.util
Class AnnotationMerging

java.lang.Object
  extended by gate.util.AnnotationMerging

public class AnnotationMerging
extends Object

Merging the annotations from different annotators. The input is the array containing the annotation set for merging. The output is a map, the key of which is the merged annotations and the values of which represent those annotators who agree on the merged annotation. Two merging methods are implemented. One method selects one annotation if at least a pre-defined number of annotators agree on it. If there are more than one merged annotations with the same span, the program selects only one annotation from them with the maximal number of annotators on it. Another method selects only one annotation from those annotations with the same span, which majority of the annotators support.


Constructor Summary
AnnotationMerging()
           
 
Method Summary
static boolean isSameInstancesForAnnotators(AnnotationSet[] annsA, int vsy)
          Check if the annotation sets contain the same annotations.
static void mergeAnnotation(AnnotationSet[] annsArr, String nameFeat, HashMap<Annotation,String> mergeAnns, int numMinK, boolean isTheSameInstances)
          Merge all annotationset from an array.
static void mergeAnnotationMajority(AnnotationSet[] annsArr, String nameFeat, HashMap<Annotation,String> mergeAnns, boolean isTheSameInstances)
          Merge all annotationset from an array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationMerging

public AnnotationMerging()
Method Detail

mergeAnnotation

public static void mergeAnnotation(AnnotationSet[] annsArr,
                                   String nameFeat,
                                   HashMap<Annotation,String> mergeAnns,
                                   int numMinK,
                                   boolean isTheSameInstances)
Merge all annotationset from an array. If one annotation is in at least numK annotation sets, then put it into the merging annotation set.


mergeAnnotationMajority

public static void mergeAnnotationMajority(AnnotationSet[] annsArr,
                                           String nameFeat,
                                           HashMap<Annotation,String> mergeAnns,
                                           boolean isTheSameInstances)
Merge all annotationset from an array. If one annotation is agreed by the majority of the annotators, then put it into the merging annotation set.


isSameInstancesForAnnotators

public static boolean isSameInstancesForAnnotators(AnnotationSet[] annsA,
                                                   int vsy)
Check if the annotation sets contain the same annotations.