public class FSUtil {
@Deprecated
public static FSIterator getAnnotationsInSpanIterator(JCas jcas, int type, int beginSpan, int endSpan)
{
ConstraintFactory constraintFactory = jcas.getConstraintFactory();
FSIntConstraint windowConstraint = constraintFactory.createIntConstraint();
windowConstraint.gt(beginSpan-1);
windowConstraint.lt(endSpan);
Type annotType = jcas.getCasType(type);
Feature beginSpanFeature = annotType.getFeatureByBaseName("begin");
Feature endSpanFeature = annotType.getFeatureByBaseName("end");
FeaturePath beginFeaturePath = jcas.createFeaturePath();
beginFeaturePath.addFeature(beginSpanFeature);
FSMatchConstraint beginSpanConstraint = constraintFactory.embedConstraint(beginFeaturePath, windowConstraint);
FeaturePath endFeaturePath = jcas.createFeaturePath();
endFeaturePath.addFeature(endSpanFeature);
FSMatchConstraint endSpanConstraint = constraintFactory.embedConstraint(endFeaturePath, windowConstraint);
FSMatchConstraint spanConstraint = constraintFactory.and(beginSpanConstraint, endSpanConstraint);
JFSIndexRepository indexes = jcas.getJFSIndexRepository();
FSIndex<?> annotIndex = indexes.getAnnotationIndex(type);
FSIterator<?> annotsInSpanItr = jcas.createFilteredIterator(annotIndex.iterator(), spanConstraint);
return annotsInSpanItr;