static L dm_gazelle_reasonAboutChatInput_v2(S userName, S content, O... _) { bool debug = boolPar debug(_); LS preContext = optPar preContext(_); GazelleEvalContext ctx = 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")); if (debug) print("Have rules: " + collect globalID(ctx.engine.rules)); gazelle_addHelperTablesToRules(ctx.engine); GazelleTree tree1 = new(ctx, content); L l = dm_gazelle_getChildren(tree1, firstConditionOnly := true, dialogHistory := preContext); if (debug) print("Tree size: " + l(l)); dm_gazelle_matchAdditionalInput2(l, preContext); 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); dm_gazelle_matchStatements(l); for (GazelleTree t : l) t.flush(); // drop unsatisfied entries l = [GazelleTree t : l | t.mr == null || !t.mr.moreConditions()]; ret l; }