Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #1010803 // web_matchAllPerms_x_bestScore

JavaX fragment (include)

1  
// nodeMatcher: func(WebNode, WebNode) -> double
2  
static double web_matchAllPerms_x_bestScore(Web patternWeb, Web inputWeb, O nodeMatcher) {
3  
  L<WebNode> patternNodes = web_nodes(patternWeb);
4  
  L<WebNode> inputNodes = web_nodes(inputWeb);
5  
  if (l(patternNodes) != l(inputNodes))
6  
    ret Double.NaN;
7  
    //fail("Can't match, differing number of nodes: " + l(patternNodes) + "/" + l(inputNodes));
8  
  
9  
  LL<WebNode> perms = allPermutations(inputNodes);
10  
  new Best<L<WebNode>> best;
11  
  for (L<WebNode> perm : perms)
12  
    best.put(perm, web_matchNodeLists_x(patternNodes, perm, nodeMatcher));
13  
  ret best.getScore();
14  
}

Author comment

Began life as a copy of #1010801

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: #1010803
Snippet name: web_matchAllPerms_x_bestScore
Eternal ID of this version: #1010803/3
Text MD5: 69632a8c2777cd4b75faa39771ba3cc5
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-10-03 21:27:19
Source code size: 621 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 316 / 330
Version history: 2 change(s)
Referenced in: [show references]