!7 cmodule OntologyHelperBot > DynAttractorBot { AttractorBot makeBot() { ret new SingleAttractorBot { void process(S s) { s = trim(s); if "ontology size" ret with emitAnswer( nStatements((L) dm_call(dm_ontologyBot(), 'concepts)) + ": " + l((L) dm_call(dm_ontologyBot(), 'conceptsWithUsefulness, true)) + " useful, " + l((L) dm_call(dm_ontologyBot(), 'conceptsWithUsefulness, false)) + " not useful, " + l((L) dm_call(dm_ontologyBot(), 'unclassifiedConcepts)) + " unclassified"); if (eqic(s, "!random")) ret with emitAnswer(call(dm_randomOntologyEntry(), 'render)); if (eqic(s, "!homepage")) ret with emitAnswer("http://monkey.botcompany.de"); if (eqic(s, "!classify")) { virtual Is entry = dm_randomUnclassifiedOntologyEntry(); if (entry == null) ret with emitAnswer("Nothing to classify!"); tempAttractor(new YesAttractor(r { print("Got yes"); call(entry, 'setUseful, true); emitAnswer("Yo, stored"); })); tempAttractor(new NoAttractor(r { print("Got no"); call(entry, 'setUseful, false); emitAnswer("Yo, stored"); })); ret with emitAnswer("Is this an acceptable general truth? " + simpleQuote((S) rcall render(entry))); } } }; } }