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

20
LINES

< > BotCompany Repo | #1011076 // ai_splitTwoNounPhrases

JavaX fragment (include)

1  
static int ai_splitTwoNounPhrases(L<S> tok1) {
2  
  ret ai_splitTwoNounPhrasesC(codeTokens(tok1))*2;
3  
}
4  
5  
// tok is code tokens only
6  
static int ai_splitTwoNounPhrasesC(L<S> tok) {
7  
  S a = first(tok), b = second(tok);
8  
  bool a1 = ai_is_myYourEtc(a);
9  
  if ((a1 || ai_is_myYourEtc_maybe(a)) && isNoun(b)) ret 2;
10  
  if (eqicOneOf(get(tok, 2), "a", "an", "the", "my", "your", "their", "our", "his", "her")) ret 2;
11  
  int i = 0;
12  
  if (a1) ++i;
13  
  ai_splitTwoNounPhrases_assumeNoun(get(tok, i));
14  
  ret i+1;
15  
}
16  
17  
svoid ai_splitTwoNounPhrases_assumeNoun(S s) {
18  
  /*if (!isNoun(s))
19  
    print("Assuming noun: " + s);*/
20  
}

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: 432 / 467
Version history: 9 change(s)
Referenced in: [show references]