Exemple #1
0
  public String talkToSelf(String input) {
    try {

      ChatterBot bot1 = factory.create(ChatterBotType.CLEVERBOT);
      ChatterBotSession bot1session = bot1.createSession();

      ChatterBot bot2 = factory.create(ChatterBotType.PANDORABOTS, "b0dafd24ee35a477");
      ChatterBotSession bot2session = bot2.createSession();

      while (continueToTalkToSelf) {

        System.out.println("bot1> " + input);

        input = bot2session.think(input);
        log.info(input);
        System.out.println("bot2> " + input);
        log.info(input);

        input = bot1session.think(input);
      }
    } catch (Exception e) {
      Logging.logException(e);
    }

    return input;
  }
Exemple #2
0
 public String think(String input) throws Exception {
   String response;
   response = session.think(input);
   response = response.toLowerCase().replace("o", "0").replace("O", "0");
   response = response.replace("cleverb0t", "Aradiabot");
   logger.debug("input=" + input);
   logger.debug("response=" + response);
   return response;
 }
Exemple #3
0
  public String chat(String toSay) {

    try {
      return session.think(toSay);
    } catch (Exception e) {
      Logging.logException(e);
    }

    return null;
  }