Warning: session_start(): open(/var/lib/php/sessions/sess_pf31njg3jjq0mt29odtp9cqa0i, 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 Line {
S text, interpretation;
sS _fieldOrder = "text interpretation";
}
cmodule SimpleWikipediaSentences > DynTableWithInput {
S topic;
start {
set fieldsInOrder;
dm_vmBus_onMessage_q('gazelleRulesChanged, r forceUpdate);
}
afterVisualize {
tablePopupMenuItem(table(), "Ignore", rThread ignoreLine);
}
void update(S topic) {
topic = trim(topic);
setField(+topic);
setModuleName(topic + " - Simple Wikipedia");
final L data = cloneList_putInField Line('text, simpleWikipedia_sentencesForTopic(topic));
fS _topic = topic;
time "Interpret Lines" {
//showText("Profile", poorMansProfileToString(r {
LPair ignore = dm_gazelle_linesToIgnoreForSimpleWikipediaTopic(_topic);
GazelleEvalContext ctx = dm_gazelle_stdEvalContext();
for i over data: {
Line l = data.get(i);
if (contains(ignore, pair(l.text, i)))
continue with l.interpretation = 'ignore;
GazelleTree tree = new(l.text);
tree.ctx = ctx;
dm_gazelle_getChildren(tree);
if (nempty(tree.children))
l.interpretation = first(tree.children).line;
}
setData(data);
//}));
}
}
void ignoreLine {
int i = selectedIndex();
Line line = selected();
if (line == null) ret;
LS context = collect text(subList(data(), 0, i));
LS comments = ll(
"out = action",
"from simple wikipedia topic " + optQuote(topic),
"previous lines = " + quote(lines_rtrim(context)));
dm_gazelle_addRuleWithComment(line.text + "\n=> ignore", lines_rtrim(comments));
}
}