!7 p-exp { replace Msg with TelegramMsg. // We're lazy! LPair l = serverTelegramLog_plusFiredRules(); new LinkedHashSet out; for i over l: { LS rules = l.get(i).b; if (empty(rules)) continue; Msg msg = l.get(i).a; int j = i+1; while (j < l(l) && l.get(j).a.sent) ++j; // Find next user msg L nextMsgs = pairsA(subList(l, i+1, j+1)); Msg userMsg = null; if (nempty(nextMsgs)) { for (Msg m : nextMsgs) if (userMsg == null && !m.sent) userMsg = m; } int score = 0; if (userMsg != null) { if (matchAny(mL("Yes Feedback Words"), userMsg.text)) ++score; if (matchAny(mL("No Feedback Words"), userMsg.text)) --score; print("Checked user msg: " + userMsg.text + " => " + score); } if (score != 0) for (S rule : rules) out.add("rule " + format_arg(rule) + " had " + (score > 0 ? "positive" : "negative") + " feedback (" + quote(userMsg.text) + ") when fired on msg " + msg.globalID + " at " + msg.date); } pnl(out); }