Warning: session_start(): open(/var/lib/php/sessions/sess_4fsm05m26ba56dkfttbui5p3j3, 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_v2(S userName, S content, O... _) {
bool debug = boolPar debug(_);
LS preContext = cast optPar preContext(_);
GazelleEvalContext ctx = cast optPar ctx(_);
if (ctx == null) ctx = dm_gazelle_stdEvalContext(dm_gazelle_allRulesWithComment(optPar requiredComment(_, "discord")));
if (debug)
print(" == PROCESSING INPUT: " + content);
// Need input as first condition
ctx.engine.dropRulesWhere(r -> cicOneOf(r.comments, "in 1 = statement", "in = statement", "disable"));
if (debug) print("Have rules: " + collect globalID(ctx.engine.rules));
gazelle_addHelpers(ctx, _);
O[] params = litparams(firstConditionOnly := true, dialogHistory := preContext, +debug,
badComments := optPar badComments(_),
acceptablePurposes := optPar acceptablePurposes(_),
respondingToHuman := optPar respondingToHuman(_));
GazelleTree tree1 = new(ctx, content);
L l = dm_gazelle_getChildren(tree1, params);
//if (debug) print("Tree size: " + l(l));
dm_gazelle_matchAdditionalInput2(l, preContext, _);
if (nempty(userName) && !boolPar skipUserName(_)) {
GazelleTree tree2 = new(ctx, optCurly(userName) + " says: " + content);
/*if (debug)*/ print("Tree2: " + tree2);
l.addAll(dm_gazelle_getChildren(tree2, paramsPlus(_, tree2 := true));
}
Long userID = cast optPar userID(_);
if (userID != null && userID != 0 && !boolPar skipUserID(_)) {
GazelleTree tree3 = new(ctx, "user with id " + userID + " says: " + content);
l.addAll(dm_gazelle_getChildren(tree3, paramsPlus(_, tree3 := true));
}
if (boolPar skipBad(_, true)) l = [GazelleTree t : l | neq(t.prediction, 'bad)];
gazelle_sortChildren(l);
dm_gazelle_matchStatements_v2(l, passParams(_, 'debug, 'dm_gazelle_matchStatementsDebug));
for (GazelleTree t : l) t.flush();
int n = l(l);
l = gazelle_dropUnsatisfiedEntries(l);
if (debug) print("Filtered out " + (n-l(l)) + " unsatisfied entries (keeping " + l(l) + ")");
gazelle_dropMatchedDefaultRules(l);
ret l;
}