MCPcopy Create free account
hub / github.com/GateNLP/gate-core / addAnn

Method addAnn

src/main/java/gate/Utils.java:870–877  ·  view source on GitHub ↗

Add a new annotation to the output annotation set outSet, spanning the same region as spanSet, and having the given type and feature map. The start and end nodes of the new annotation will be new nodes. This method will convert the checked InvalidOffsetException that can be raised by AnnotationSet.a

(AnnotationSet outSet, AnnotationSet spanSet,
      String type, FeatureMap fm)

Source from the content-addressed store, hash-verified

868 * @return Returns the Id of the added annotation
869 */
870 public static Integer addAnn(AnnotationSet outSet, AnnotationSet spanSet,
871 String type, FeatureMap fm) {
872 try {
873 return outSet.add(start(spanSet), end(spanSet), type, fm);
874 } catch (InvalidOffsetException ex) {
875 throw new GateRuntimeException("Offset error when trying to add new annotation: ", ex);
876 }
877 }
878
879 /**
880 * Add a new annotation to the output annotation set outSet, spanning the

Callers 1

Calls 3

startMethod · 0.95
endMethod · 0.95
addMethod · 0.65

Tested by 1