1 | static S ai_simplifyNP(S s) { |
2 | try answer dropAfterSubString_orNull(s, " in order to "); |
3 | try answer dropAfterSubString_orNull(s, " you "); |
4 | |
5 | s = ai_dropLeadingAdverbs(s); |
6 | |
7 | L<S> tok = nlTok(s); |
8 | |
9 | /*if (eqicGet(tok, 1, "the") |
10 | && isNoun(get(tok, 3)) |
11 | && eqicGet(tok, 5, "of")) |
12 | ret joinTakeFirst(tok, 4);*/ |
13 | |
14 | int i = indexOfPred(tok, f isPreposition); |
15 | if (i >= 0) ret joinTakeFirst(tok, i-1); |
16 | |
17 | ret s; |
18 | } |
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: | #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: | 526 / 544 |
Version history: | 7 change(s) |
Referenced in: | [show references] |