!7 sS data = [[ -- rule 1 who is x y [input] + x y is a trader [statement] => a trader -- test input john doe is a guy who is john doe? -- expected output a guy ]]; !include once #1021761 // Fakery p-exp { TreeMap sections = minusSignSectionsCI(data); for (S ruleID, ruleText : keysStartingWith(sections, "rule")) { new LS comments; LS lines = tlft(ruleText); for i over lines: { S s = lines.get(i); PairS p = splitTrailingSquareBracketStuff(s); if (nempty(p.b)) comments.add("in " + (i+1) + " = " + p.b); lines.set(i, p.a); } rules.add(t3(lines(lines), lines(comments), ruleID)); } dm_gazelle_wireStatementConditions(); pnlStruct(rules); new LS lines; for (S input : tlft(sections.get("test input"))) { gazelle_gatherFulfillments(ll(nu GazelleLine(text := input)), fulfillments, debug := true); lines.addAll(printLines(collect line(dm_gazelle_reasonAboutChatInput(null, input, requiredComment := null, debug := true)))); } assertEqualsVerbose(lines, tlft(sections.get("expected output"))); }