static new ThreadLocal web_matchAllPerms_partial_score; static Map web_matchAllPerms_partial(Web patternWeb, Web inputWeb) { ret web_matchAllPerms_partial(patternWeb, inputWeb, 0); } static Map web_matchAllPerms_partial(Web patternWeb, Web inputWeb, double minScore) { L patternNodes = web_nodes(patternWeb); L inputNodes = web_nodes(inputWeb); if (l(patternNodes) > l(inputNodes)) null; new Best> best; LL subsets = allSubsetsOfLength(l(patternNodes), inputNodes); for (L subset : subsets) { LL perms = allPermutations(subset); for (L perm : perms) best.put(perm, web_matchNodeLists(patternNodes, perm)); } L l = isNaN(minScore) ? best! : best.getIfScoreAbove(minScore); web_matchAllPerms_partial_score.set(best.score()); ret l == null ? null : twoListsToOrderedMap(patternNodes, l); }