Warning: session_start(): open(/var/lib/php/sessions/sess_bcl8s355ljamvjtuc33uao9k9t, 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 QuestionDetectionTrainer > DynPrintLogAndEnabled {
start {
thread { mainLoop(); }
}
void mainLoop enter {
while true {
S x = input();
if (!enabled) continue;
if (probablyAQuestion(x))
say("I don't know");
else if (probablyNotAQuestion(x)) {
sayNothing();
thread {
S y = input();
if (match("That was a question", y)) {
saveIsQuestion(y, "yes");
say("Oh, sorry. Stored.");
}
}
} else {
say("Is that a question?");
S y = input();
if (dm_isYes(y)) { y = "yes"; say("OK, stored"); }
else if (dm_isNo(y)) { y = "no"; say("OK, stored"); }
else y = "(?) " + y;
saveIsQuestion(x, y);
}
}
}
bool probablyAQuestion(S s) { ret false; }
bool probablyNotAQuestion(S s) { ret false; }
void saveIsQuestion(S text, S isQuestion) {
dm_requireAndCallModule("#1020788/IsQuestionExamples", 'addEntry, text, isQuestion);
}
void sayNothing() {}
S input() { ret print("> ", dm_waitForTopInput()); }
void say(S s) { dm_say(s); }
}