TypeSystem typeSystem = fromJcas.getTypeSystem();
Type docType = typeSystem.getType(UIMAConstants.TYPE_DOCUMENT);
CasCopier casCopier = new CasCopier(fromJcas.getCas(), modview.getCas());
for (Annotation annotation : annotationIndex) {
// TODO be careful here, because some people inherit from DocumentAnnotation
if (typeSystem.subsumes(docType, annotation.getType())) {
continue;
}
Annotation clone = (Annotation) casCopier.copyFs(annotation);
// change the view/sofa of the new annotation...
// see: http://osdir.com/ml/apache.uima.general/2007-09/msg00107.html