java - 使用chatterbean AIML解释器制作alice机器人

标签 java tags aiml

每当我尝试加载 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/

相关文章:

java - 使用 Java commons-httpclient 以及从 .pfx 中提取的 cacert、cert 和 key

Java:没有返回的三元。 (用于方法调用)

python - 从 Algorithmia 运行自动标记

prolog - 如何在Prolog中实现AIML?

java - 如何修改读取 vector 的正则表达式来读取矩阵?

java - 如果在静态初始化 block 中创建线程,程序将挂起

python-3.x - 如何在 R 脚本 ".rive"脚本中执行 Python 对象宏?

c# - 如何找到缺少片段的字符串?

javascript - 如何使用 Javascript 打印到 HTML 标签

html - 如何为图像而不是表格使用 html 5 <caption> 标签