Warning: session_start(): open(/var/lib/php/sessions/sess_hk1en9m7q2utpk7htm0dgf4j1p, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!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");
PTElement e = root;
if (e instanceof HaveCategories)
e = first(e.children); // Choose most likely reconstruction
if (e instanceof ChoosePart) {
WeightedProduction prod = e/ChoosePart.reconstruction.production;
print("Hint: " + prod.simplificationHint);
if (eq(prod.simplificationHint, "L"))
print("SIMPLIFIED >> " + e/ChoosePart.a.text());
else if (eq(prod.simplificationHint, "R"))
print("SIMPLIFIED >> " + e/ChoosePart.b.text());
}
});
bool shouldPrint = neq(rendered, lastOutput);
lastOutput = rendered;
if (shouldPrint) print("\n> " + s + "\n" + rendered);
}
}