当前位置: 首页>>代码示例>>Java>>正文


Java ChatterBotFactory类代码示例

本文整理汇总了Java中com.google.code.chatterbotapi.ChatterBotFactory的典型用法代码示例。如果您正苦于以下问题:Java ChatterBotFactory类的具体用法?Java ChatterBotFactory怎么用?Java ChatterBotFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ChatterBotFactory类属于com.google.code.chatterbotapi包,在下文中一共展示了ChatterBotFactory类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initGui

import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
@Override
public void initGui()
{
	this.reponse = this.getRandomString();
       this.textfield = new GuiTextField(this.fontRendererObj, this.width / 2 - 150, 50, 300, 20);
       this.textfield.setMaxStringLength(300);
       this.textfield.setFocused(true);
       
       this.factory = new ChatterBotFactory();
       try {
		this.bot = this.factory.create(ChatterBotType.PANDORABOTS, "b0dafd24ee35a477");
        this.bot_session = this.bot.createSession();
	} catch (Exception e) {
		e.printStackTrace();
	}
       
       this.buttonList.add(new GuiButton(42, this.width / 4, this.height - 40, this.width / 2, 20, ChatColor.RESET + "Say"));
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:19,代码来源:GuiSlave.java

示例2: PrivateMessageChatThread

import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public PrivateMessageChatThread(MessageChannel messageChannel, JDA jda, User user, Message firstMessage, Map<User, PrivateMessageChatThread> chatThreadMap) {
    super(messageChannel, jda, user);

    this.threadsMap = chatThreadMap;
    this.botFactory = new ChatterBotFactory();
    this.active = true;
    this.user = user;

    createBotSessions();

    if (firstMessage == null) messageChannel.sendMessage("Hey, wanna talk?");
    else setScannedMessaged(firstMessage);

    jda.addEventListener(this);

    chatThreadMap.put(user, this);
}
 
开发者ID:iSach,项目名称:Samaritan,代码行数:18,代码来源:PrivateMessageChatThread.java

示例3: createClever

import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
private ChatterBot createClever() {
    try {
        return new ChatterBotFactory()
            .create(ChatterBotType.CLEVERBOT, sentryProperties.getDiscord().getCleverBotApiKey());
    } catch (Exception e) {
        log.warn("Could not create CleverBot session", e);
    }
    return null;
}
 
开发者ID:quanticc,项目名称:sentry,代码行数:10,代码来源:Chatter.java

示例4: CleverBotListener

import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public CleverBotListener(JDA jda) {
    this.jda = jda;
    this.botFactory = new ChatterBotFactory();

    createBotSessions();

    jda.addEventListener(this);
}
 
开发者ID:iSach,项目名称:Samaritan,代码行数:9,代码来源:CleverBotListener.java

示例5: CleverbotSession

import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public CleverbotSession() throws Exception
{
	JSONObject json = new JSONObject(Util.getFileContents("config.json"));
	ChatterBotFactory factory = new ChatterBotFactory();
	ChatterBot bot = factory.create(ChatterBotType.CLEVERBOT, json.getString("cleverbotAPIKey"));

	session = bot.createSession(Locale.ENGLISH);
}
 
开发者ID:Vauff,项目名称:Maunz-Discord,代码行数:9,代码来源:CleverbotSession.java

示例6: init

import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public boolean init() {
	try {
		factory = new ChatterBotFactory();
		// chatterbot = factory.create(type);
		chatterbot = factory.create(ChatterBotType.PANDORABOTS, "b0dafd24ee35a477");
		// chatterbot = factory.create(ChatterBotType.CLEVERBOT);
		session = chatterbot.createSession();
	} catch (Exception e) {
		Logging.logError(e);
	}
	return true;
}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:13,代码来源:CleverBot.java

示例7: CommandCleverbot

import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public CommandCleverbot() {
    try {
        bot = new ChatterBotFactory().create(ChatterBotType.CLEVERBOT).createSession();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:rowtn,项目名称:SkypeNet,代码行数:8,代码来源:CommandCleverbot.java

示例8: init

import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public boolean init() {
  try {
    factory = new ChatterBotFactory();
    // chatterbot = factory.create(type);
    chatterbot = factory.create(ChatterBotType.PANDORABOTS, "b0dafd24ee35a477");
    // chatterbot = factory.create(ChatterBotType.CLEVERBOT);
    session = chatterbot.createSession();
  } catch (Exception e) {
    Logging.logError(e);
  }
  return true;
}
 
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:13,代码来源:CleverBot.java

示例9: ChatBot

import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public ChatBot() {
	factory  = new ChatterBotFactory();
	try {
		bot = factory.create(ChatterBotType.CLEVERBOT);
	} catch (Exception e) {
		e.printStackTrace();
	}
	session = bot.createSession();
}
 
开发者ID:KazeEspada,项目名称:IRCBot,代码行数:10,代码来源:ChatBot.java

示例10: run

import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public void run() {
    Thread.currentThread().setName("ChatterBot");
    try {
        ChatterBotFactory factory = new ChatterBotFactory();
        com.google.code.chatterbotapi.ChatterBot bot1 = factory.create(ChatterBotType.CLEVERBOT);
        ChatterBotSession bot1session = bot1.createSession();
        while (isRunning) while (UserAnswered) {
            s = bot1session.think(s);
            UserAnswered = false;
            Chat.unlockWaiter();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:harry2258,项目名称:AlfredV2-FTB-IRC-,代码行数:16,代码来源:ChatterBot.java

示例11: CleverbotCommand

import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public CleverbotCommand(Charrizard charrizard) {
    super("clever", "Talk with CleverBot");
    this.charrizard = charrizard;
    this.factory = new ChatterBotFactory();
    this.chatterBotSessionCache = CacheBuilder.newBuilder().expireAfterAccess(5, TimeUnit.MINUTES).build();
}
 
开发者ID:kacperduras,项目名称:Charrizard,代码行数:7,代码来源:CleverbotCommand.java

示例12: getChatFactory

import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
protected static ChatterBotFactory getChatFactory() {
    return chatFactory;
}
 
开发者ID:zom,项目名称:zombot-java,代码行数:4,代码来源:BasicBot.java

示例13: ChatBot

import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public ChatBot() {
	super("ChatBot", "Chat AI", false);
	factory = new ChatterBotFactory();
}
 
开发者ID:Kitt3120,项目名称:ViperBot,代码行数:5,代码来源:ChatBot.java


注:本文中的com.google.code.chatterbotapi.ChatterBotFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。