static new ThreadLocal applyNLLogicFacts_v4_iterate_withFailed2_verbose; svoid applyNLLogicFacts_v4_iterate_withFailed2(S input, VF2 onRuleFired, VF4, Exp> onRuleFailed) { applyNLLogicFacts_v4_iterate_withFailed2(input, onRuleFired, onRuleFailed, mL_facts()); } svoid applyNLLogicFacts_v4_iterate_withFailed2(S input, VF2 onRuleFired, VF4, Exp> onRuleFailed, LS facts) { applyNLLogicFacts_v4_iterate_withFailed2(input, onRuleFired, onRuleFailed, facts, ai_mL_parsedLogicExamples2()); } svoid applyNLLogicFacts_v4_iterate_withFailed2(S input, VF2 onRuleFired, VF4, Exp> onRuleFailed, LS facts, L rules) { new NLLogicChecker_v2 c; //c.matcher = new NLStringMatcher_dollarVars; addAll(c.facts, facts); c.input = input; applyNLLogicFacts_v4_iterate_withFailed2(c, onRuleFired, onRuleFailed, rules); } svoid applyNLLogicFacts_v4_iterate_withFailed2(final NLLogicChecker_v2 c, final VF2 onRuleFired, final VF4, Exp> onRuleFailed, L rules) { c.rules = rules; for (final IfThen rule : rules) pcall { final new NLLogicChecker_v2.Matching m; m.verbose = isTrue(applyNLLogicFacts_v4_iterate_withFailed2_verbose!); if (m.verbose) print("Checking rule (iterating): " + rule); nlLogic_iterate_withOnFail2(c, rule.in, m, new L, r { if (m.verbose) { print("Matched " + quote(c.input) + " with rule " + quote(rule)); printStruct(" ", m.matches); } callF(onRuleFired, rule, m); }, voidfunc(L satisfiedConditions, Exp e) { callF(onRuleFailed, rule, m, satisfiedConditions, e) }); } }