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

18
LINES

< > BotCompany Repo | #1011195 - ai_simplifyNP - simplify noun phrases

JavaX fragment (include)

static S ai_simplifyNP(S s) {
  try answer dropAfterSubString_orNull(s, " in order to ");
  try answer dropAfterSubString_orNull(s, " you ");
    
  s = ai_dropLeadingAdverbs(s);
  
  L<S> tok = nlTok(s);
  
  /*if (eqicGet(tok, 1, "the")
    && isNoun(get(tok, 3))
    && eqicGet(tok, 5, "of"))
    ret joinTakeFirst(tok, 4);*/
    
  int i = indexOfPred(tok, f isPreposition);
  if (i >= 0) ret joinTakeFirst(tok, i-1);
  
  ret s;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1011195
Snippet name: ai_simplifyNP - simplify noun phrases
Eternal ID of this version: #1011195/8
Text MD5: 8a32e476ece95eb7330fd642a44089db
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-04 01:01:41
Source code size: 452 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 297 / 299
Version history: 7 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1011195 & http://1011195.tinybrain.de