1 | svoid ai_askForUnknownWordTypes(S s) {
|
2 | PTElement tree = ai_parseToTreeWithGuessing(s); |
3 | L<S> unknownWords = ai_unknownWordsInSentence(s); |
4 | for (S word : unknownWords) {
|
5 | L<PTElement> e = ai_scanParseTreeForWord_all_tighter(tree, word); |
6 | L<S> categories = uniquify(notNulls(mapMethod(e, 'category))); |
7 | if (empty(categories)) |
8 | emit("What type of word is " + quote(word) + "?");
|
9 | else |
10 | emit("Is " + quote(word) + " " + curlyOpt(textOut_or_orAll_curly(map a(map deAngleBracket(categories)))) + "?");
|
11 | } |
12 | } |
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: | #1017497 |
| Snippet name: | ai_askForUnknownWordTypes - uses emit |
| Eternal ID of this version: | #1017497/4 |
| Text MD5: | 483ccc110c2783367dc69ec14ae8a37d |
| Author: | stefan |
| Category: | javax / a.i. |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-07-24 01:41:00 |
| Source code size: | 538 bytes / 12 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 539 / 598 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |