static S ai_guessVerb(S s) {
S a = firstWord(s);
if (a == null) null;
if (ai_questionWord_1(a)) { s = dropFirstWord(s); a = firstWord(s); }
if (ai_yesNoQuestionWord_1(a) && neqicOneOf(a, "am", "are", "is")) {
S s2 = dropFirstWord(s);
S v = firstVerb(s2);
if (v != null)
if (eqic(a, "does")) ret verbToThirdPerson(v) + "?";
else if (eqic(a, "do")) ret v + "?";
else if (eqic(a, "did")) ret verbToPast(v) + "?";
else ret a + " " + v + "?";
}
if (isVerb(a)) ret a + "?";
s = ai_skipNounPhrase(s);
ret firstVerb(s);
}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: | 916 / 947 |
| Version history: | 17 change(s) |
| Referenced in: | [show references] |