static new ThreadLocal applyNLLogicFacts_v4_iterate_verbose; svoid applyNLLogicFacts_v4_iterate(S input, VF2 onRuleFired) { applyNLLogicFacts_v4_iterate(input, onRuleFired, mL_facts()); } svoid applyNLLogicFacts_v4_iterate(S input, VF2 onRuleFired, LS facts) { applyNLLogicFacts_v4_iterate(input, onRuleFired, facts, ai_mL_parsedLogicExamples2()); } svoid applyNLLogicFacts_v4_iterate(S input, VF2 onRuleFired, LS facts, L rules) { new NLLogicChecker_v2 c; c.matcher = new NLStringMatcher_dollarVars; addAll(c.facts, facts); c.input = input; applyNLLogicFacts_v4_iterate(c, onRuleFired, rules); } svoid applyNLLogicFacts_v4_iterate(final NLLogicChecker_v2 c, final VF2 onRuleFired, L rules) { c.rules = rules; for (final IfThen rule : rules) pcall { final new NLLogicChecker_v2.Matching m; m.verbose = isTrue(applyNLLogicFacts_v4_iterate_verbose!); if (m.verbose) print("Checking rule (iterating): " + rule); c.iterate(rule.in, m, r { if (m.verbose) { print("Matched " + quote(c.input) + " with rule " + quote(rule)); printStruct(" ", m.matches); } callF(onRuleFired, rule, m); }); } }