Exemple #1
0
    @Override
    protected String doInBackground(String... params) {
      ChatterBotFactory factory = new ChatterBotFactory();

      ChatterBot bot1 = null;
      try {
        bot1 = factory.create(ChatterBotType.CLEVERBOT);
      } catch (Exception e) {
        e.printStackTrace();
      }
      ChatterBotSession bot1session = bot1.createSession();

      //            ChatterBot bot2 = null;
      //            try {
      //                bot2 = factory.create(ChatterBotType.PANDORABOTS, "b0dafd24ee35a477");
      //            } catch (Exception e) {
      //                e.printStackTrace();
      //            }
      //            ChatterBotSession bot2session = bot2.createSession();

      String s = params[0];

      try {
        return bot1session.think(s);
      } catch (Exception e) {
        e.printStackTrace();
      }
      return null;
    }