Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

38
LINES

< > BotCompany Repo | #1022854 // AI_FactsBot [dev.]

JavaX fragment (include)

1  
sclass AI_FactsBot > AttractorBot {
2  
  Collection<S> facts = synchroCISet();
3  
  
4  
  public void run {
5  
    say("I can store facts. Just type them. " + n2(facts, "fact") + " stored.");
6  
  }
7  
  
8  
  // CONFIG
9  
  
10  
  class QuestionAttractor > Attractor {
11  
    public bool matches(S s) {
12  
      ret ai_isQuestion_2(s);
13  
    }
14  
    
15  
    public void run {
16  
      say("I cannot answer questions yet");
17  
    }
18  
  }
19  
  
20  
  class StoreFactAttractor > Attractor {
21  
    S category;
22  
    
23  
    public bool matches(S s) {
24  
      true;
25  
    }
26  
    
27  
    public void run {
28  
      if (facts.add(line))
29  
        say("Fact stored");
30  
      else
31  
        say("I know");
32  
    }
33  
  }
34  
  
35  
  *() {
36  
    standardAttractors(new QuestionAttractor, new StoreFactAttractor);
37  
  }
38  
}

Author comment

Began life as a copy of #1022843

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: #1022854
Snippet name: AI_FactsBot [dev.]
Eternal ID of this version: #1022854/4
Text MD5: bc8696b616133b7caa8af9934c014a6a
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-11 14:44:25
Source code size: 754 bytes / 38 lines
Pitched / IR pitched: No / No
Views / Downloads: 342 / 772
Version history: 3 change(s)
Referenced in: [show references]