sbool nlLogic_matchRandomFact(NLLogicChecker_v2 c, S pat, NLLogicChecker_v2.Matching m) { LS patterns = tok_splitAtVerticalBar(pat); LinkedHashMap m2 = null; new L> choices; for (S fact : c.facts) { if (m2 == null) m2 = cloneLinkedHashMap(m.matches); bool result = nlLogic_matchMultiplePatterns(c, patterns, fact, m2); if (m.verbose) print("matched " + quote(pat) + " with " + quote(fact) + " & " + sfu(m.matches) + " => " + result); if (result) { choices.add(m2); m2 = null; } } if (empty(choices)) false; m.matches = random(choices); true; }