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

20
LINES

< > BotCompany Repo | #1011076 // ai_splitTwoNounPhrases

JavaX fragment (include)

static int ai_splitTwoNounPhrases(L<S> tok1) {
  ret ai_splitTwoNounPhrasesC(codeTokens(tok1))*2;
}

// tok is code tokens only
static int ai_splitTwoNounPhrasesC(L<S> tok) {
  S a = first(tok), b = second(tok);
  bool a1 = ai_is_myYourEtc(a);
  if ((a1 || ai_is_myYourEtc_maybe(a)) && isNoun(b)) ret 2;
  if (eqicOneOf(get(tok, 2), "a", "an", "the", "my", "your", "their", "our", "his", "her")) ret 2;
  int i = 0;
  if (a1) ++i;
  ai_splitTwoNounPhrases_assumeNoun(get(tok, i));
  ret i+1;
}

svoid ai_splitTwoNounPhrases_assumeNoun(S s) {
  /*if (!isNoun(s))
    print("Assuming noun: " + 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: #1011076
Snippet name: ai_splitTwoNounPhrases
Eternal ID of this version: #1011076/10
Text MD5: 6cf56bb38922bb0772093f4b8194fcd7
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-24 12:28:01
Source code size: 618 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 431 / 466
Version history: 9 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1012578 - ai_splitTwoNounPhrasesByCase