每当我尝试加载 Alice AIML 文件时,我都会收到有关未找到标签的各种错误,但是当我修复这些错误时,我会收到一个错误,我不知道如何修复。 AIML 的东西没有被实现,但是当我查看 AIML 类时,它正在实现它:? 我的代码:
public static String input()
{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
//System.out.println("you say>");
String input = "";
try
{
input = in.readLine();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return input;
}
public static void main(String[] args) throws Exception
{
Chat ch=new Chat();
AliceBotMother mother = new AliceBotMother();
mother.setUp();
AliceBot bot = mother.newInstance();
System.err.println(bot.respond("welcome"));
while(true)
{
String input = Chat.input();
// while the user saying 'bye'
if(Chat.END.equalsIgnoreCase(input))
break;
// do some respond..
System.err.println("Alice>" + bot.respond(input));
}
最佳答案
Chatterbean 是一个不再受支持的旧 Java 程序。您应该使用较新的 Java AIML 2.0 库 Program AB,地址为 https://code.google.com/p/program-ab/
关于java - 使用chatterbean AIML解释器制作alice机器人,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15419663/