1 | static PTElement ai_parseToTreeWithGuessing(S input) { |
2 | L<S> words = ai_uncategorizedWordsInSentence(input); |
3 | //print("Have " + n2(words, "unknown word")); |
4 | |
5 | new AI_BottomUpParser1 parser; |
6 | parser.wordsToCategories = DerivedMap(ai_wordToCategories()); |
7 | Map<S, Map<S, Double>> guessMap = new HashMap; |
8 | temp tempSetThreadLocal(ai_getWordToCategoryWeight_map, guessMap); |
9 | for (S word : words) { |
10 | Map<S, Double> map = ai_guessCategoriesForUnknownWord_weighted(word); |
11 | guessMap.put(word, map); |
12 | parser.wordsToCategories.put(word, keys(map)); |
13 | } |
14 | ret ai_parseBottomUpToTree(parser, input); |
15 | } |
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: | #1017469 |
Snippet name: | ai_parseToTreeWithGuessing - guesses categories for unknown words |
Eternal ID of this version: | #1017469/4 |
Text MD5: | 61d1464ac4df6b1be99dceba70be4b57 |
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-23 16:40:53 |
Source code size: | 621 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 421 / 455 |
Version history: | 3 change(s) |
Referenced in: | [show references] |