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)

sclass AI_FactsBot > AttractorBot {
  Collection<S> facts = synchroCISet();
  
  public void run {
    say("I can store facts. Just type them. " + n2(facts, "fact") + " stored.");
  }
  
  // CONFIG
  
  class QuestionAttractor > Attractor {
    public bool matches(S s) {
      ret ai_isQuestion_2(s);
    }
    
    public void run {
      say("I cannot answer questions yet");
    }
  }
  
  class StoreFactAttractor > Attractor {
    S category;
    
    public bool matches(S s) {
      true;
    }
    
    public void run {
      if (facts.add(line))
        say("Fact stored");
      else
        say("I know");
    }
  }
  
  *() {
    standardAttractors(new QuestionAttractor, new StoreFactAttractor);
  }
}

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: 340 / 770
Version history: 3 change(s)
Referenced in: [show references]