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

17
LINES

< > BotCompany Repo | #1011058 // ai_guessVerb

JavaX fragment (include)

1  
static S ai_guessVerb(S s) {
2  
  S a = firstWord(s);
3  
  if (a == null) null;
4  
  if (ai_questionWord_1(a)) { s = dropFirstWord(s); a = firstWord(s); }
5  
  if (ai_yesNoQuestionWord_1(a) && neqicOneOf(a, "am", "are", "is")) {
6  
    S s2 = dropFirstWord(s);
7  
    S v = firstVerb(s2);
8  
    if (v != null)
9  
      if (eqic(a, "does")) ret verbToThirdPerson(v) + "?";
10  
      else if (eqic(a, "do")) ret v + "?";
11  
      else if (eqic(a, "did")) ret verbToPast(v) + "?";
12  
      else ret a + " " + v + "?";
13  
  }
14  
  if (isVerb(a)) ret a + "?";
15  
  s = ai_skipNounPhrase(s);
16  
  ret firstVerb(s);
17  
}

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: #1011058
Snippet name: ai_guessVerb
Eternal ID of this version: #1011058/18
Text MD5: cc9ca8494f16be1b35015f3fe6e708b2
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-10-12 01:35:07
Source code size: 581 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 439 / 475
Version history: 17 change(s)
Referenced in: [show references]