Warning: session_start(): open(/var/lib/php/sessions/sess_g7uc8d453ljls4r130t16121b4, 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
// matches first condition, leaves rest in MatchedRule
static L ai_ruleEngine2_rulesForInput_4(RuleEngine2 engine, SS inputsByType) {
new L l;
for (RuleEngine2.Rule rule : engine.rules) {
TextAndType in = first(rule.insWithType);
S cond = in.text;
S tokenize = or(matchAny_firstGroup("tokenize with *", rule.comments), f javaTokNPunctuationWithBrackets);
LS tokC = (LS) callAndMake(tokenize, cond);
LS input = inputsByType.get(in.type);
if (input == null) continue;
LS tokI = (LS) callAndMake(tokenize, q);
tokI = ai_applyWordSplitPattern1(tokC, tokI);
SS map = zipTwoListsToCIMap_strict_withoutEquals(tokC, tokI);
if (map == null) continue;
//print(map + " | " + cond + " | " + rule.vars);
final new RuleEngine2_MatchedRule matched;
matched.rule = rule;
matched.map = map;
matched.matchedLines.add(pair(tokC, tokI));
matched.tokenizationFunction = tokenize;
matched.remainingConditions = nullIfEmpty(map(dropFirst(rule.in), func(S s) -> S { matched.applyMappingTo(s) }));
matched.remainingConditionsWithType = nullIfEmpty(map(dropFirst(rule.insWithType), func(TextAndType in) -> S { 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)));
}
l.add(matched);
}
ret l;
}