sbool web_mergeNodesByFirstLabel_debug; static void web_mergeNodesByFirstLabel(Web web) { web_check(web); new HashMap<Lisp, WebNode> index; for (WebNode node : web.nodes) if (!(node instanceof WebRelation) && nempty(node.labels)) index.put(first(node.labels), node); for (WebNode node : cloneList(web.nodes)) if (!(node instanceof WebRelation) && nempty(node.labels)) { WebNode n = index.get(first(node.labels)); if (n == node) continue; if (web_mergeNodesByFirstLabel_debug) print("Collapsing: " + node + " => " + n); web_collapseNodeTo(node, n); } web_check(web); }
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: | #1009979 |
Snippet name: | web_mergeNodesByFirstLabel |
Eternal ID of this version: | #1009979/6 |
Text MD5: | 4d444158b15ce6d4dfe70dae0b6a9d9b |
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-02 01:08:38 |
Source code size: | 625 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 567 / 612 |
Version history: | 5 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1010123 - web_mergeNodes - synonym of web_mergeNodesByFirstLabel #1010255 - web_firstLabelIndex #1010445 - web_mergeNodesByFirstLabelIC |