}
public DebugRuleElementMatch createDebugRuleElementMatch(RuleElementMatch rem, RutaStream stream,
boolean addToIndex) {
JCas cas = stream.getJCas();
DebugRuleElementMatch drem = new DebugRuleElementMatch(cas);
DebugEvaluatedCondition base = new DebugEvaluatedCondition(cas);
base.setValue(rem.isBaseConditionMatched());
RuleElement ruleElement = rem.getRuleElement();
String baseString = "";
if (ruleElement instanceof RutaRuleElement) {
baseString = verbalizer.verbalizeMatcher((RutaRuleElement) ruleElement);
} else if (ruleElement instanceof ComposedRuleElement) {
baseString = verbalizer.verbalizeComposed((ComposedRuleElement) ruleElement);
}
base.setElement(baseString);
drem.setBaseCondition(base);
drem.setConditions(createEvaluatedConditions(rem, stream, addToIndex));
List<AnnotationFS> annotations = rem.getTextsMatched();
if (!annotations.isEmpty()) {
drem.setBegin(annotations.get(0).getBegin());
drem.setEnd(annotations.get(annotations.size() - 1).getEnd());
}
if (addToIndex)
drem.addToIndexes();
return drem;
}