Warning: session_start(): open(/var/lib/php/sessions/sess_07dvvggvfl37flg38fglkseom2, 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
cmodule TheoryMaker > DynConvo {
/*
1. measurable features (fields of object)
2. higher level features (words the user throws in)
3. make theories (random statements)
4. check theories
1. show a random line
2. user types keyword
3. assign keyword to line
line $a has keyword $x & line $a's text is $bla
& line $y has text $bla => line $b might have keyword $x
*/
L msgs; // full dialog
L shownMsgs;
new Map, Bool> msg2label;
start-thread {
if (empty(msgs))
setField(msgs := mainCruddieLog());
showARandomMsg();
}
void showMsgs(L l) {
setField(shownMsgs := l);
setMsgs(l);
}
void showARandomMsg {
setMsgs(randomElementAsList(msgs));
}
@Override
void sendInput2(S s) {
// treat input as a label
if (l(shownMsgs) == 1) {
Msg shown = first(shownMsgs);
new Matches m;
if "not ..." {
S label = m.rest();
msg2label.put(pair(shown, label), false);
} else {
S label = s;
msg2label.put(pair(shown, label), true);
}
}
}
}