}
private FSMatchConstraint createWindowConstraint(AnnotationFS windowAnnotation, CAS cas) {
if (windowAnnotation == null)
return null;
FeaturePath beginFP = cas.createFeaturePath();
Type type = windowAnnotation.getType();
beginFP.addFeature(type.getFeatureByBaseName("begin"));
FSIntConstraint intConstraint = cf.createIntConstraint();
intConstraint.geq(windowAnnotation.getBegin());
FSMatchConstraint beginConstraint = cf.embedConstraint(beginFP, intConstraint);
FeaturePath endFP = cas.createFeaturePath();
endFP.addFeature(type.getFeatureByBaseName("end"));
intConstraint = cf.createIntConstraint();
intConstraint.leq(windowAnnotation.getEnd());
FSMatchConstraint endConstraint = cf.embedConstraint(endFP, intConstraint);
FSMatchConstraint windowConstraint = cf.and(beginConstraint, endConstraint);