!7 sclass BottomUpParser > DynPrintLogWithInput { transient S lastOutput; start { dm_useLocallyCopiedMechLists(); set flag NoFancyMechParsing. doEvery(5000, r { update(inputChooser.input()) }); } void update(fS s) { temp enter(); S rendered = hijackPrint(r { PTElement root = ai_parseBottomUpToTree(s); if (root == null) ret with print("No parse"); print("Have parse: " + className(root) + " - " + root); PTElement e = root; while (e instanceof ChooseCategory || e instanceof HaveCategory) { print("Getting first in " + e); e = first(e.children); // Choose most likely reconstruction } if (e instanceof ChoosePart) { ai_Reconstructed r = e/ChoosePart.reconstruction; WeightedProduction prod = r.production; print("Hint: " + prod.simplificationHint + " in prod: " + sfu(prod)); if (eq(prod.simplificationHint, "L")) print("SIMPLIFIED >> " + r.a.text()); else if (eq(prod.simplificationHint, "R")) print("SIMPLIFIED >> " + r.b.text()); //else print("Hint: " + prod.simplificationHint); } }); bool shouldPrint = neq(rendered, lastOutput); lastOutput = rendered; if (shouldPrint) print("\n> " + s + "\n" + rendered); } }