Warning: session_start(): open(/var/lib/php/sessions/sess_uajvcq5gv4cf9aiql0ue29iijg, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
// true if successful
// only call if there are more conditions
sbool ai_ruleEngine2_matchStep(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) continue;
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;
}