Warning: session_start(): open(/var/lib/php/sessions/sess_hv8251fte25birpg33dgsgjej6, 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
module SpeechRecogConfirmation > DynPrintLogAndButtons {
start {
onSpeechRecognized_withoutMyUtterancesAndTyped(voidfunc(fS s) {
print("\nI heard: " + quote(s));
if (eq(s, "?")) {
fS q = "Did you say anything?";
showButtons(q,
"Yes", r { log(s, q, 'yes); whatDidYouSay(s); },
"No", r { log(s, q, 'no); print("Thanks"); });
} else {
fS q = "Did you say that?";
showButtons(q,
"Yes", r { log(s, q, 'yes); print("Thanks"); },
"No", r { log(s, q, 'no); whatDidYouSay(s); });
}
});
}
void log(S heard, S question, S answer) {
print("> " + upper(answer));
logStructure(programLogFile(), litorderedmap(+heard, +question, +answer));
hideButtons();
}
void whatDidYouSay(fS heard) {
S q = print("What did you say?");
VF1 f = voidfunc(S corrected) {
corrected = trim(corrected);
print("> I said " + empty(corrected) ? "nothing" : quote(upper(corrected)));
logStructure(programLogFile(), litorderedmap(+heard, +corrected));
hideButtons();
print("Thanks");
if (neq(heard, corrected)) dm_setAIBarTextAndFire(corrected);
};
showButtons2(q,
focusedTextFieldAndButton(heard, "is what I said", f),
textFieldAndButton(heard, "is what I said", f));
}
void hideButtons {
super.hideButtons();
dm_setTrayIcon_left(null);
}
void showButtons(fS q, O... params) {
print(q);
super.showButtons(params);
dm_setTrayIcon_left(jPreferredSizeToFixedSize(buttonsAsfillerlessHStack(singlePlusArray(jlabel(q), params))));
}
void showButtons2(S q, JComponent buttonsForTray, JComponent buttonsForMyWindow) {
print(q);
super.showButtons(buttonsForMyWindow);
dm_setTrayIcon_left(jPreferredSizeToFixedSize(buttonsForTray));
}
}