!7 replace defaultParse with javaTokWithBrackets_cached. sS data = [[ ---- Rules I ate pizza with a fork. => I used a fork to eat pizza. I used a fork to eat pizza. => I used a fork. I used a fork. => A fork is a tool. I ate pizza with pepperoni. => {I ate pizza} and {The pizza had pepperoni on it}. The pizza had pepperoni on it. => Pepperoni is edible. I ate pizza with Bob. => {I ate pizza} and {Bob was with me}. Bob was with me. => Bob is a person. A and B. => A. A and B => B. nicer wording for {is it true that {Mom is a person.}?} = {is Mom a person?} nicer wording for {is it true that {Mom is edible.}?} = {is Mom edible?} ---- Input I ate pizza with mom. I ate pizza with anchovis. I ate pizza with ducks. I ate pizza with my hands. ]]; p-exp { centerBigTTConsole(); SS sections = asCIMap(minusSignsSections(data)); LS rulesRaw = splitAtEmptyLines(sections.get("Rules")); //pnl(rulesRaw); LPair rules = mapNonNulls splitAtDoubleArrow_pair(rulesRaw); //pnlStruct(rules); print(); LS inputs = tlft(sections.get("Input")); for (S input : inputs) { print("\n" + input); new MultiSet ms; LS tokI = defaultParse(input); for (PairS rule : rules) { LS tokR = defaultParse(rule.a); SS map = ciMapWithoutKeysEqualToValues(zipTwoListsToCIMap_strict(codeTokens_lazy(tokR), codeTokens_lazy(tokI))); if (map == null) continue; ms.add(rule, l(tokR)-l(map)+1); print(" " + map + " | " + rule.a); } print(" Best rules: " + renderMultiSet(msMapKeys pairA(ms))); } }