1 | static void ai_spec_moveToMiddle(S term) { |
2 | L<WebRelation> mtmRels = ai_spec_moveToMiddle_mtmRels(); |
3 | for ping (Web web : indexedWebs(term)) |
4 | ai_spec_moveToMiddle(web, mtmRels); |
5 | } |
6 | |
7 | static void ai_spec_moveToMiddle(Web web) { |
8 | ai_spec_moveToMiddle(web, ai_spec_moveToMiddle_mtmRels()); |
9 | } |
10 | |
11 | static void ai_spec_moveToMiddle(Web web, L<WebRelation> mtmRels) { |
12 | for (WebRelation r : web_relationObjects(web)) { |
13 | S rel = web_text(r), b = web_text(r.b); |
14 | for (WebRelation mtm : mtmRels) { |
15 | L<S> l = splitAtSlash_keepAll(web_text(mtm.a)); |
16 | L<S> lReplacement = splitAtSlash_keepAll(web_text(mtm.b)); |
17 | //print("Trying " + sfu(l) + " -> " + sfu(lReplacement) + " on " + rel + " / " + b); |
18 | continue unless l(l) == 2 && l(lReplacement) == 2; |
19 | new Matches m; |
20 | S prefix = second(l) + " "; |
21 | continue unless eqic(first(l), rel) && swic(b, prefix, m); |
22 | //print("Match."); |
23 | |
24 | ai_postTriple(web_text(r.a), first(lReplacement), |
25 | second(lReplacement) + " " + m.rest()); |
26 | } |
27 | } |
28 | } |
29 | |
30 | static L<WebRelation> ai_spec_moveToMiddle_mtmRels() { |
31 | ret indexedRelations_verified("move to middle"); |
32 | } |
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: | #1011734 |
Snippet name: | ai_spec_moveToMiddle |
Eternal ID of this version: | #1011734/13 |
Text MD5: | 8d88320da7f5b476fd06cec902104f2c |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-01-07 17:04:27 |
Source code size: | 1169 bytes / 32 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 546 / 562 |
Version history: | 12 change(s) |
Referenced in: | [show references] |