Warning: session_start(): open(/var/lib/php/sessions/sess_g27i10lva6f73s25mao430diih, 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
static L dm_gazelle_reasonAboutChatInput(S userName, S content, O... _) {
GazelleEvalContext ctx = dm_gazelle_stdEvalContext(dm_gazelle_allRulesWithComment("discord"));
// Need input as first condition
ctx.engine.dropRulesWhere(r -> cicOneOf(r.comments, "in 1 = statement", "in = statement"));
gazelle_addHelperTablesToRules(ctx.engine);
GazelleTree tree1 = new(ctx, content);
L l = dm_gazelle_getChildren(tree1, firstConditionOnly := true);
GazelleTree tree2 = new(ctx, optCurly(userName) + " says: " + content);
l.addAll(dm_gazelle_getChildren(tree2, firstConditionOnly := true));
if (boolPar skipBad(_, true)) l = [GazelleTree t : l | neq(t.prediction, 'bad)];
gazelle_sortChildren(l);
for (GazelleTree t : l)
if (t.rule() != null) {
LS in = t.rule().in;
int iCond = t.mr.iCond;
if (l(in) > iCond) {
LS conditions = dropFirst(iCond, in);
print("Remaining conditions for " + t.ruleID() + ": " + conditions);
new Matches m;
if (!matchAny("in " + (iCond+1) + " = statement *", t.rule().comments, m))
continue with print("Unwired condition");
S subRuleID = $1;
print("Found subrule: " + subRuleID);
L fulfillments = dm_gazelle_fulfillmentsForRule(subRuleID);
print("Have fulfillments:");
for (O f : fulfillments) {
SS varMap = safeUnstructMap(getString varMap(f));
printIndent(varMap);
SS newMap = mergeMapsStrictlyIC(t.mr.map, varMap);
if (newMap == null)
continue with printIndent("Can't merge maps");
printIndent("Maps merged! => " + newMap);
t.mr.map = newMap;
t.mr.iCond++;
break;
}
}
}
ret l;
}