1 | static L<PTElement> ai_extractEntities_v1(S input) { |
2 | if (startsWith(input, "!")) ret emptyList(); // skip commands |
3 | input = ai_lookupCurlyCheatSheet(input); |
4 | ret ai_extractEntities_v1(ai_parseToCulledTree(input)); |
5 | } |
6 | |
7 | static L<PTElement> ai_extractEntities_v1(PTElement tree) { |
8 | new HashSet<PTElement> toSkip; |
9 | new L<PTElement> out; |
10 | for (PTElement e : ai_scanParseTreeForCategory(tree, "<noun>")) { |
11 | if (toSkip.contains(e)) continue; |
12 | //print("Entity found: " + e.text()); |
13 | out.add(e); |
14 | PTElement ee = ai_parseTree_simplifyNode(e); |
15 | if (ee != null && ee != e) |
16 | toSkip.add(ee); |
17 | } |
18 | ret out; |
19 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1017743 |
Snippet name: | ai_extractEntities_v1 - extracts <noun> phrases from ai_parseToCulledTree |
Eternal ID of this version: | #1017743/7 |
Text MD5: | b6312a2c618cf590e5f420bca3b8c129 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-09-25 14:16:27 |
Source code size: | 638 bytes / 19 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 390 / 442 |
Version history: | 6 change(s) |
Referenced in: | [show references] |