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

11
LINES

< > BotCompany Repo | #1011749 // ai_spec_parseAnd

JavaX fragment (include)

static L<S> ai_spec_parseAnd_words = ll("and", "of", "or", "for");

static void ai_spec_parseAnd(S s) {
  L<S> tok = tok_combineCurlyBrackets_keep(javaTok(s));
  for (S word : ai_spec_parseAnd_words) {
    int i = indexOfIC(tok, word);
    if (i < 3 || i >= l(tok)-2) continue;
    T3<S> t = tok_tripleSplitAtToken(tok, i);
    ai_postTriple(s, "possibly parses as", optionalCurlyBrace(dropSuffix(",", t.a)) + " " + t.b + " " + optionalCurlyBrace(t.c));
  }
}

Author comment

Began life as a copy of #1011748

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: #1011749
Snippet name: ai_spec_parseAnd
Eternal ID of this version: #1011749/13
Text MD5: b7cc05d6913be725551fea64cb89444a
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-09 01:41:10
Source code size: 469 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 394 / 438
Version history: 12 change(s)
Referenced in: [show references]