Download Jar. Uses 3874K of libraries. Click here for Pure Java version (11105L/81K).
!7 static L<S> guessCategories = ll("<noun>", "<verb>", "<adjective>"); p-exp { S word = "GKHJGLF"; S sentence = "What is " + word + "?"; PTElement tree = ai_parseBottomUpToTree(sentence); print(tree); assertNull(tree); L<S> words = ai_uncategorizedWordsInSentence(sentence); print("Have " + n2(words, "unknown word")); for (L<S> combo : allCombinations(rep(guessCategories, l(words)))) { new AI_BottomUpParser1 parser; parser.wordsToCategories = cloneMap(ai_wordToCategories()); L<PairS> zipped = zipTwoListsToPairs(words, combo); for (PairS p : zipped) parser.wordsToCategories.put(p.a, litciset(p.b)); PTElement tree2 = ai_parseBottomUpToTree(parser, sentence); print(zipped + " => " + tree2); parser.printWordsAndGroups(); } }
Began life as a copy of #1017353
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: | #1017450 |
| Snippet name: | Test guessing category for unknown word v1 [OK] |
| Eternal ID of this version: | #1017450/11 |
| Text MD5: | c595e1215c81aca929f982f40171603a |
| Transpilation MD5: | ac5f4d660d636b101a8400baf3a5ae70 |
| Author: | stefan |
| Category: | javax / a.i. |
| Type: | JavaX source code (desktop) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-07-22 13:42:03 |
| Source code size: | 814 bytes / 25 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 675 / 1527 |
| Version history: | 10 change(s) |
| Referenced in: | [show references] |