!7 cmodule IWantYouToBe > DynAttractorBot { transient WordTokRule rule = wordTokReplacerRule( "I want you to be my assistant", "assistant", "I want that {you are my assistant}"); S standardSwitcheroo(S s) { ret switcheroo(s); } transient WordTokRule rule = new WordTokRule("I want that X", "X") { run { S x_simplified = simpleSpaces_nTok(getVar("X")); if (contains(facts, x_simplified)) emit("But " + x_simplified + " already"); } } transient Set facts = litciset("Computery is usery's assistant"); class Bot > AttractorBot { addStandardAttractor(new DefaultAttractor { run { S rewritten = applyWordTokRule(rule, input); if (rewritten == null) ret; } }); } } AttractorBot makeBot() { ret new Bot; } }