final QueryComposite queryComposite, Type matchedType, Type ruleApplyType,
Type blockApplyType, Feature innerApplyFeature, Feature ruleApplyFeature) {
int ret = 0;
if (fs.getType().equals(blockApplyType)) {
FeatureStructure featureValue = fs.getFeatureValue(innerApplyFeature);
FSArray array = (FSArray) featureValue;
for (int i = 0; i < array.size(); i++) {
AnnotationFS eachApply = (AnnotationFS) array.get(i);
ret += findRuleMatches(result, eachApply, file, queryComposite, matchedType,
ruleApplyType, blockApplyType, innerApplyFeature, ruleApplyFeature);
}
} else if (fs.getType().equals(ruleApplyType)) {
FeatureStructure featureValue = fs.getFeatureValue(ruleApplyFeature);
FSArray array = (FSArray) featureValue;
for (int i = 0; i < array.size(); i++) {
AnnotationFS eachApply = (AnnotationFS) array.get(i);
ret += findRuleMatches(result, eachApply, file, queryComposite, matchedType,
ruleApplyType, blockApplyType, innerApplyFeature, ruleApplyFeature);
}
} else if (fs.getType().equals(matchedType)) {
result.add(new QueryResult(fs.getBegin(), fs.getEnd(), fs.getCoveredText(), file));