!7 p-exp { S s = "{At some point in the past} I go for a walkkk"; L tok = javaTokPlusBrackets(s); tok = dropPunctuation(tok); pnlStruct(tok); useLocalMechListMirrorsIfBotActive_verbose(); // Pre-parse curly fragments & guess categories for unknown words Map> guessMap = new HashMap; new AI_BottomUpParser1 parser; parser.wordsToCategories = DerivedMap(ai_wordToCategories()); for (int i = 1; i < l(tok); i += 2) { S t = tok.get(i); if (isCurlyBraced(t)) { tok.set(i, t = uncurly(t)); PTElement tree = ai_parseToTreeWithGuessing(t); if (tree != null) { //preparsed.put(i, tree); print(className(tree)); print(ai_renderCulledParseTree(tree)); if (!tree instanceof ChooseCategory) print("Weird: " + className(tree)); else { for (HaveCategory c : (L) (L) tree.children) subHashMap(guessMap, t).put(c.category, c.totalWeight); } } else print("No parse for " + t); } else if (ai_isUncategorizedWord(t)) guessMap.put(t, ai_guessCategoriesForUnknownWord_weighted(t)); } temp tempSetThreadLocal(ai_getWordToCategoryWeight_map, guessMap); for (S word : keys(guessMap)) parser.wordsToCategories.put(word, keys(guessMap.get(word))); PTElement tree = ai_parseBottomUpToTree(parser, tok); print(ai_renderCulledParseTree(tree)); }