// true if successful // only call if there are more conditions sbool ai_ruleEngine2_matchStep(final RuleEngine2_MatchedRule matched, SS inputsByType) { RuleEngine2.Rule rule = matched.rule; TextAndType in = rule.insWithType.get(matched.iCond); matched.iCond++; S cond = in.text; S tokenize = matched.tokenizationFunction; LS tokC = (LS) callAndMake(tokenize, cond); S input = inputsByType.get(in.type); if (input == null) false; LS tokI = (LS) callAndMake(tokenize, input); tokI = ai_applyWordSplitPattern1(tokC, tokI); SS map = zipTwoListsToCIMap_strict_withoutEquals(tokC, tokI); if (map == null) false; //print(map + " | " + cond + " | " + rule.vars); matched.matchedLines.add(pair(tokC, tokI)); matched.remainingConditions = nullIfEmpty(map(dropFirst(matched.iCond, rule.in), func(S s) -> S { matched.applyMappingTo(s) })); matched.remainingConditionsWithType = nullIfEmpty(map(dropFirst(matched.iCond, rule.insWithType), func(TextAndType in) -> TextAndType { TextAndType(matched.applyMappingTo(in.text), in.type) })); Map qualities = ai_ruleEngine2_mappingQualities(rule); for (S a, b : map) { mapPut(matched.mappingQuality, a, qualities.get(pair(a, b))); } true; }