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)
| 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 |