// This allows to link prefix, suffix and lookup annotations by their IDs
protected Integer addAnAnnotation(Document theDocument,
AnnotationSet set, int from, int to, String type, FeatureMap fm) {
Integer id = null;
if (set instanceof AnnotationSetImpl) {
AnnotationSetImpl setasannimpl = (AnnotationSetImpl) set;
try {
id = setasannimpl.add(new Long(from), new Long(to), type, fm);
} catch (InvalidOffsetException ex) {
throw new GateRuntimeException("Invalid offset exception - doclen/from/to="
+ theDocument.getContent().size() + "/" + from + "/" + to, ex);
}
} else {