static new ThreadLocal applyNLLogicFacts_v4_verbose; svoid applyNLLogicFacts_v4(S input, VF2 onRuleFired) { applyNLLogicFacts_v4(input, onRuleFired, mL_facts()); } svoid applyNLLogicFacts_v4(S input, VF2 onRuleFired, LS facts) { applyNLLogicFacts_v4(input, onRuleFired, facts, ai_mL_parsedLogicExamples2()); } svoid applyNLLogicFacts_v4(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(c, onRuleFired, rules); } svoid applyNLLogicFacts_v4(NLLogicChecker_v2 c, VF2 onRuleFired, L rules) { c.rules = rules; for (IfThen rule : rules) pcall { new NLLogicChecker_v2.Matching m; m.verbose = isTrue(applyNLLogicFacts_v4_verbose!); if (m.verbose) print("Checking rule: " + rule); if (c.checkRule(rule, m)) { print("Matched " + quote(c.input) + " with rule " + quote(rule)); printStruct(m.matches); callF(onRuleFired, rule, m); } } }