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

19
LINES

< > BotCompany Repo | #1012303 // ai_answerIsQuestion

JavaX fragment (include)

1  
// e.g. i -> am? -> a bot
2  
static S ai_answerIsQuestion(T3<S> t) {
3  
  if (!eqicOneOf(t.b, "am?", "are?", "is?")) null;
4  
  
5  
  // find out what t.a is
6  
  L<S> is_l = ai_superclasses(t.a, dropQuestionMark(t.b));
7  
  printStruct(+is_l);
8  
  
9  
  // find out what t.c is
10  
  L<S> askedFor_l = ai_superclasses(t.c);
11  
  printStruct(+askedFor_l);
12  
  
13  
  for (S askedFor : askedFor_l)
14  
    for (S is : is_l)
15  
      if (has(is, "is not", askedFor))
16  
        ret "No - " + is + " is not " + askedFor;
17  
  
18  
  null;
19  
}

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