for(Context candidate: candidates) {
if(candidate.equals(questionContext)) {
LogInfo.logs("RuleTransformationModel: Exact match",questionContext,candidate);
res.clear();
res.put(candidate, new DoubleContainer(1.0));
break;
}
double matchCount = rules.match(questionContext,candidate).value();
if(matchCount>0.0) {
LogInfo.logs("RuleTransformationModel: question=%s, match=%s, score=%s",questionContext,candidate,matchCount);
res.put(candidate, new DoubleContainer(matchCount));
}
}
MathUtils.normalizeDoubleMap(res);
return CollectionUtils.doubleContainerToDoubleMap(res);
}