Warning: session_start(): open(/var/lib/php/sessions/sess_cgv7kai92thgac3tfhlrp4o1o7, 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
sS botName = "Dictation.";
static JTextArea ta;
static IVar text;
static Splitter1 commandOrText;
p-subst {
if (nempty(sendOpt(botName, "activate"))) { cleanKill(); ret; }
commandOrText = persistentObject("Command or text splitter", Splitter1);
text = persistentVar("Text");
swing {
showFrame(ta = jtextArea(text!));
onUpdate(ta, r { text.set(getText(ta)) });
exitProgramOnFrameClose(ta);
}
bot(botName);
prioMe();
hideConsole();
}
svoid prioMe {
sendOpt("Voice Actions", "prio bot *", botName);
}
svoid cleanMeUp {
sendOpt("Voice Actions", "prio bot done *", botName);
}
answer {
if "activate" {
prioMe();
activateFrame(ta);
ret "OK";
}
if "user said *" {
onUtterance($1);
ret "OK";
}
}
svoid onUtterance(S s) {
Either e = commandOrText(s);
if (e.isA())
interpretCommand(e.a());
else
appendToTextArea(ta, e.b() + "\n");
}
static Either commandOrText(S s) {
if (eq(s, "dictation done")) ret eitherA(s);
int i = commandOrText.get(s);
if (i != 0) ret i == 1 ? eitherA(s) : eitherB(s);
ret eitherB(s);
}
svoid interpretCommand(S s) {
if "dictation done" {
sendOpt("Voice Actions", "prio bot done *", botName);
cleanKill();
}
}