in ConfigurableFeatureExtractor/src/main/java/org/apache/uima/tools/cfe/CommonFeatureMatcher.java [350:397]
void processFeatureAnnotationWindow(JCas jcas,
Annotation enclosing,
AnnotationMatchedValue trg_mv,
TargetAnnotationDescriptor tad,
FeatureObjectMatcher fom,
Collection<AnnotationMatchedValue> allowedAnnotations,
int begin_lower,
int begin_upper,
int end_lower,
int end_upper,
int windowsize,
boolean advance_right)
throws IllegalArgumentException,
SecurityException,
NoSuchElementException,
ClassNotFoundException,
IllegalAccessException,
NoSuchFieldException,
InvocationTargetException
{
Class<? extends Annotation> ann_cls = UIMAAnnotationUtils.getAnnotationClass(fom.getMatcherClass());
FSIterator<? extends Annotation> ann_it = FeatureConstrainedIterator.getEnclosedIterator(
jcas, ann_cls, begin_lower, begin_upper, end_lower, end_upper);
if (!advance_right) {
ann_it.moveToLast();
}
Annotation trg = (Annotation)trg_mv.m_matchedObject;
for (int wc = 1; ann_it.isValid() && (wc <= windowsize);) {
Annotation ann = (Annotation)ann_it.get();
AnnotationMatchedValue feat_mv = MatchedValue.get(allowedAnnotations, ann);
if (null == feat_mv) {
continue;
}
if (processFeatureAnnotation(jcas, enclosing, trg_mv, feat_mv, tad, fom, orientationFlags(ann, trg), wc)) {
++wc;
}
if (advance_right) {
ann_it.moveToNext();
}
else {
ann_it.moveToPrevious();
}
}
}