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

23
LINES

< > BotCompany Repo | #1012032 // ai_spec_moveToMiddle_triple

JavaX fragment (include)

static void ai_spec_moveToMiddle_triple(S term) {
  T3<S> t = ai_parseTriple(term);
  if (t != null)
    ai_spec_moveToMiddle_triple(term, t, ai_spec_moveToMiddle_mtmRels());
}

static void ai_spec_moveToMiddle_triple(S term, T3<S> t, L<WebRelation> mtmRels) {
  if (t == null) ret;
  S rel = t.b, b = t.c;
  for (WebRelation mtm : mtmRels) {
    L<S> l = splitAtSlash_keepAll(web_text(mtm.a));
    L<S> lReplacement = splitAtSlash_keepAll(web_text(mtm.b));
    //print("Trying " + sfu(l) + " -> " + sfu(lReplacement) + " on " + rel + " / " + b);
    continue unless l(l) == 2 && l(lReplacement) == 2;
    new Matches m;
    S prefix = second(l) + " ";
    continue unless eqic(first(l), rel) && swic(b, prefix, m);
    //print("Match.");
    
    ai_postTriple(term, "is identical to",
      ai_renderTriple(t.a, first(lReplacement), second(lReplacement) + " " + m.rest()));
  }
}

Author comment

Began life as a copy of #1011734

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: #1012032
Snippet name: ai_spec_moveToMiddle_triple
Eternal ID of this version: #1012032/7
Text MD5: 317ce07a93b135751592e101e0120099
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-16 06:38:52
Source code size: 903 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 319 / 363
Version history: 6 change(s)
Referenced in: [show references]