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)

// nodeMatcher: func(WebNode, WebNode) -> double
static double web_matchAllPerms_x_bestScore(Web patternWeb, Web inputWeb, O nodeMatcher) {
  L<WebNode> patternNodes = web_nodes(patternWeb);
  L<WebNode> inputNodes = web_nodes(inputWeb);
  if (l(patternNodes) != l(inputNodes))
    ret Double.NaN;
    //fail("Can't match, differing number of nodes: " + l(patternNodes) + "/" + l(inputNodes));
  
  LL<WebNode> perms = allPermutations(inputNodes);
  new Best<L<WebNode>> best;
  for (L<WebNode> perm : perms)
    best.put(perm, web_matchNodeLists_x(patternNodes, perm, nodeMatcher));
  ret best.getScore();
}

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: 399 / 402
Version history: 2 change(s)
Referenced in: [show references]