!7 sclass BottomUpParser > DynPrintLogWithInput { transient S lastOutput; start { dm_useLocallyCopiedMechLists(); set flag NoFancyMechParsing. doEvery(5000, r { update(inputChooser.input()) }); } void update(S s) { temp enter(); final new AI_BottomUpParser1 parser; parser.parse(s); S rendered = hijackPrint(r { parser.printWordsAndGroups(); parser.printConstituentsOfFullGroup(); AI_BottomUpParser1.Word w = parser.fullGroup(); if (w == null) ret; for (S cat : w.classes) { L l = ai_buParser1_reconstructedProductions(parser, ai_buParser_parseWeightedProductions(), w, cat); print("Reconstructions as " + cat + ":"); pnl(l); } }); bool shouldPrint = neq(rendered, lastOutput); lastOutput = rendered; if (shouldPrint) print("\n> " + s + "\n" + rendered); } }