Uses 911K of libraries. Click here for Pure Java version (13137L/68K).
1 | !7 |
2 | |
3 | cmodule OntologyHelperBot > DynAttractorBot {
|
4 | AttractorBot makeBot() {
|
5 | ret new SingleAttractorBot {
|
6 | void process(S s) {
|
7 | s = trim(s); |
8 | |
9 | if "ontology size" ret with emitAnswer( |
10 | nStatements((L) dm_call(dm_ontologyBot(), 'concepts)) + ": " + |
11 | l((L) dm_call(dm_ontologyBot(), 'conceptsWithUsefulness, true)) |
12 | + " useful, " + |
13 | l((L) dm_call(dm_ontologyBot(), 'conceptsWithUsefulness, false)) |
14 | + " not useful, " |
15 | + l((L) dm_call(dm_ontologyBot(), 'unclassifiedConcepts)) + " unclassified"); |
16 | |
17 | if (eqic(s, "!random")) |
18 | ret with emitAnswer(call(dm_randomOntologyEntry(), 'render)); |
19 | |
20 | if (eqic(s, "!homepage")) |
21 | ret with emitAnswer("http://monkey.botcompany.de");
|
22 | |
23 | if (eqic(s, "!classify")) {
|
24 | virtual Is entry = dm_randomUnclassifiedOntologyEntry(); |
25 | if (entry == null) ret with emitAnswer("Nothing to classify!");
|
26 | tempAttractor(new YesAttractor(r {
|
27 | print("Got yes");
|
28 | call(entry, 'setUseful, true); |
29 | emitAnswer("Yo, stored");
|
30 | })); |
31 | tempAttractor(new NoAttractor(r {
|
32 | print("Got no");
|
33 | call(entry, 'setUseful, false); |
34 | emitAnswer("Yo, stored");
|
35 | })); |
36 | ret with emitAnswer("Is this an acceptable general truth? " + simpleQuote((S) rcall render(entry)));
|
37 | } |
38 | } |
39 | }; |
40 | } |
41 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1023476 |
| Snippet name: | Ontology Helper Bot |
| Eternal ID of this version: | #1023476/13 |
| Text MD5: | 681b250df58804329c1fab8d76e609fd |
| Transpilation MD5: | 6476395aa3e339223f9608d98ff6abba |
| Author: | stefan |
| Category: | javax / a.i. |
| Type: | JavaX source code (Dynamic Module) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-06-25 15:45:26 |
| Source code size: | 1501 bytes / 41 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 593 / 1162 |
| Version history: | 12 change(s) |
| Referenced in: | [show references] |