Warning: session_start(): open(/var/lib/php/sessions/sess_4ca1ibtpjugsnurkn0ncq0mihm, 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
srecord Guesser(S regexp, S annotation) {}
cmodule CLAG > DynPrintLogAndEnabled {
new Map entries; // text -> annotations
L guessers = litsynclist(Guesser("eval", "eval command"));
start {
doEvery(1.0, r step);
}
void step enter {
if (!enabled) ret;
temp tempPrintTime();
dm_clearModulePrintLog();
// find annotator module
S mod = annotator();
if (empty(mod)) ret;
// get visible rows
IntRange vis = cast quickImport(dm_rcall visibleRows(mod));
if (vis == null) ret;
L allData = (L) dm_rcall data(mod);
L visibleData = subList(allData, vis);
// get all annotations
Set all = cast dm_rcall allAnnotations(mod);
print(+all);
bool change;
fOr (virtual Entry e : visibleData) {
S text = getString text(e);
LS annotations = cast rcall annotations(e);
entries.put(text, annotations);
Set guesses = ciSet();
for (Guesser guesser : guessers)
if (regexpFindIC(guesser.regexp, text))
guesses.add(guesser.annotation);
S guess = joinWithComma(guesses);
if (set_trueIfChanged(e, +guess)) set change;
}
if (change) dm_rcall fireDataChanged(mod);
}
S annotator() {
ret dm_moduleWithSnippetID(#1024172);
}
}