!7 p { new Matches m; S base = "heise.de 2018/04/20 (raw)"; L full = mechList(base); for (S list : mechListsPlusNumber(barCombine(base, "Similar lines"))) { L l = mechList(list); int nTheory = 1; for (S s : mechList(barCombine(list, "Theories"))) { L rest = listMinusSet(full, l); L entries; if "all lines start with *" entries = startingWithIC(rest, $1); else if "all lines end with *" entries = endingWithIC(rest, $1); else { print("Uninterpretable theory: " + s); continue; } print("Theory " + s + ": Found " + n2(entries, "more entry", "more entries") + "/" + l(rest)); if (nempty(entries)) editMechList(barCombine(list, "Theory " + nTheory + " | More matching lines"), entries); ++nTheory; } } }