Warning: session_start(): open(/var/lib/php/sessions/sess_6djumbdga7us4vtmtl4vbaj66q, 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
static JLabel l;
static Map consequentsMap = synchroCIMap(), precedentsMap = synchroCIMap();
static Set ignoreSet = asCISet(splitAtVerticalBar("english|englisch|german|deutsch"));
sS answer;
p-noconsole-autoupdate {
final JFrame frame = showMaximizedFrame(jscroll_verticalExtend_trackWidth(jTiledBackground(#1007195,
setForeground(Color.white, setFontSize(120, l = jcenteredlabel_noToolTip())))));
addToWindowWithMargin(frame, jcenteredbutton("Say", f sayIt));
final L> receivers = ll(
consequentsMap_receiver(consequentsMap), precedentsMap_receiver(precedentsMap));
time "Loading" { loading {
mapVoidMulti(receivers, notNulls(map prepLine(dropLast(linesOfFile(speechRecognitionLog())))));
} }
tailFileLinewisePlusLastLine(speechRecognitionLog(), 100, voidfunc(S utterance) {
if (empty(utterance = prepLine(trimLastLine(utterance)))) ret;
print(">> " + utterance);
mapVoidMulti(receivers, ll(utterance));
answer = consequentsMap.get(utterance);
if (empty(answer)) answer = precedentsMap.get(utterance);
S both = utterance;
if (nempty(answer)) {
both += "\n\n" + answer;
logQuotedWithTime("guessLog", both);
}
setTitle(frame, both.replaceAll("\n+", " > ");
setText(l, jlabel_textAsHTML_center(both));
printIndentUnlessEmpty(">> ", pcallAnswerMethod(utterance));
});
}
sS prepLine(S s) { ret nullIfInSet(ignoreSet, unquoteAndDropAngleBracketStuff(s)); }
answer {
if "font size *"
ret "OK" with revalidate(setFontSize(parseInt($1), l));
}
svoid sayIt {
if (empty(answer)) ret;
william(answer);
}