1 | static Map<WebNode> web_matchAllPerms_partial_scoreF(Web patternWeb, Web inputWeb, O scoreFunction) { |
2 | L<WebNode> patternNodes = web_nodes(patternWeb); |
3 | L<WebNode> inputNodes = web_nodes(inputWeb); |
4 | if (l(patternNodes) > l(inputNodes)) |
5 | null; |
6 | |
7 | new Best<L<WebNode>> best; |
8 | LL<WebNode> subsets = allSubsetsOfLength(l(patternNodes), inputNodes); |
9 | for (L<WebNode> subset : subsets) { |
10 | LL<WebNode> perms = allPermutations(subset); |
11 | for (L<WebNode> perm : perms) |
12 | best.put(perm, toDouble(callF(scoreFunction, patternNodes, perm))); |
13 | } |
14 | |
15 | L<WebNode> l = best.getIfScoreAbove(0); |
16 | ret l == null ? null : twoListsToOrderedMap(patternNodes, l); |
17 | } |
Began life as a copy of #1010467
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1010591 |
Snippet name: | web_matchAllPerms_partial_scoreF - pattern may be subnet of input |
Eternal ID of this version: | #1010591/1 |
Text MD5: | 8d76aeab674a77f5e3a7feb08e2f98d3 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-09-22 17:28:40 |
Source code size: | 677 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 457 / 497 |
Referenced in: | [show references] |