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

19
LINES

< > BotCompany Repo | #1012303 // ai_answerIsQuestion

JavaX fragment (include)

// e.g. i -> am? -> a bot
static S ai_answerIsQuestion(T3<S> t) {
  if (!eqicOneOf(t.b, "am?", "are?", "is?")) null;
  
  // find out what t.a is
  L<S> is_l = ai_superclasses(t.a, dropQuestionMark(t.b));
  printStruct(+is_l);
  
  // find out what t.c is
  L<S> askedFor_l = ai_superclasses(t.c);
  printStruct(+askedFor_l);
  
  for (S askedFor : askedFor_l)
    for (S is : is_l)
      if (has(is, "is not", askedFor))
        ret "No - " + is + " is not " + askedFor;
  
  null;
}

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: #1012303
Snippet name: ai_answerIsQuestion
Eternal ID of this version: #1012303/3
Text MD5: 0d2545f3d1e5a72e96f5b5ec60244fad
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-27 14:03:58
Source code size: 502 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 406 / 440
Version history: 2 change(s)
Referenced in: [show references]