Warning: session_start(): open(/var/lib/php/sessions/sess_4gp1igho97j51t58chmr3gc4os, 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
sclass AI_WhatIsBot > AttractorBot {
Long now;
public void run {
say("I can learn and tell you what things are");
}
// CONFIG
class WhatIsAttractor > Attractor {
S term;
public bool matches(S s) {
new Matches m;
if "what is ..."
ret true with term = $1;
false;
}
public void run {
say("OK. What is " + quote(term) + "?");
lowPrioAttractor(DefinitionAttractor(term));
}
}
record DefinitionAttractor(S term) extends Attractor {
S value;
public bool matches(S s) {
new Matches m;
if "it's ...|it is...|he is...|she is..."
ret true with value = $1;
false;
}
public void run {
print("OK. " + term + " is " + value + ".");
}
}
*() {
standardAttractors(new WhatIsAttractor);
}
}