static PTElement ai_parseToTreeWithGuessing_fromTok(L tok) { tok = dropPunctuation(tok); L words = ai_uncategorizedWordsInSentence(tok); //print("Have " + n2(words, "unknown word")); new AI_BottomUpParser1 parser; parser.wordsToCategories = DerivedMap(ai_wordToCategories()); Map> guessMap = new HashMap; temp tempSetThreadLocal(ai_getWordToCategoryWeight_map, guessMap); for (S word : words) { Map map = ai_guessCategoriesForUnknownWord_weighted(word); guessMap.put(word, map); parser.wordsToCategories.put(word, keys(map)); } ret ai_parseBottomUpToTree(parser, tok); }