}
@Override
public void execute(RuleMatch match, RuleElement element, RutaStream stream, InferenceCrowd crowd) {
RutaBlock block = element.getParent();
RutaTable table = tableExpr.getTable(block);
int index = indexExpr.getIntegerValue(block, match, element, stream);
Type type = typeExpr.getType(block);
Map<String, Integer> map = new HashMap<String, Integer>();
for (IStringExpression each : featureMap.keySet()) {
map.put(each.getStringValue(block, match, element, stream), featureMap.get(each)
.getIntegerValue(block, match, element, stream));
}
boolean ignoreCaseValue = ignoreCase != null ? ignoreCase.getBooleanValue(element.getParent(),
null, stream) : false;
int ignoreLengthValue = ignoreLength != null ? ignoreLength.getIntegerValue(
element.getParent(), null, stream) : 0;
String ignoreCharValue = ignoreChar != null ? ignoreChar.getStringValue(element.getParent(),
null, stream) : "";
int maxIgnoreCharValue = maxIgnoreChar != null ? maxIgnoreChar.getIntegerValue(
element.getParent(), null, stream) : 0;
RutaWordList wordList = table.getWordList(index);
Collection<AnnotationFS> found = wordList.find(stream, ignoreCaseValue, ignoreLengthValue,
ignoreCharValue.toCharArray(), maxIgnoreCharValue, true);
for (AnnotationFS annotationFS : found) {
List<String> rowWhere = table.getRowWhere(index - 1, annotationFS.getCoveredText());
FeatureStructure newFS = stream.getCas().createFS(type);
if (newFS instanceof Annotation) {
Annotation a = (Annotation) newFS;
a.setBegin(annotationFS.getBegin());
a.setEnd(annotationFS.getEnd());