简体   繁体   English

如何在我自己的程序中使用带有函数的 ChatScript 库?

[英]How can I use ChatScript Library with function in my own program?

How can I write a program that inside it, I can call ChatScript program, pass my input file to it and get the results as an output text file?我如何编写一个程序,在其中调用 ChatScript 程序,将我的输入文件传递给它并以输出文本文件的形式获取结果?

This is a example using ChatScript Library :这是使用 ChatScript 库的示例:

#include <fstream>
#include <iostream>
#include <string>
#include <chatScript.h> //for example!
using namespace std;

int main()
{
    ofstream output;
    string str1, str2;
    getline(cin, str1);

    //This is the ChatScript function that i am looking for!
    str2= ChatScript_input(str1); 

    output.open("output.txt");
    output<< "str2";
    output.close();

    return 0;
}

I would suggest you ask the developer of ChatScript directly on the forum he monitors https://www.chatbots.org/ai_zone/viewforum/44/ Hope this is not against the rules here to post a link to an external forum.我建议您直接在他监控的论坛上询问 ChatScript 的开发人员https://www.chatbots.org/ai_zone/viewforum/44/希望这不违反此处发布指向外部论坛的链接的规则。

As far as I understand CS opens a socket through which you are supposed to communicate with it.据我了解,CS 打开一个套接字,您应该通过它与之通信。 Here is the manual explaining how that can be done: https://github.com/bwilcox-1234/ChatScript/blob/master/WIKI/CLIENTS-AND-SERVERS/ChatScript-ClientServer-Manual.md这是解释如何做到这一点的手册: https : //github.com/bwilcox-1234/ChatScript/blob/master/WIKI/CLIENTS-AND-SERVERS/ChatScript-ClientServer-Manual.md

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在脚本的OOB之后对句子进行模式检查 - How to do a pattern check for sentence after the OOB in chatscript 响应聊天脚本中的多个匹配项 - Responding to multiple matches in Chatscript 如何构建集成到Watson的自己的IOS / android聊天界面 - How do I build my own IOS/ android chat interface integrated to Watson 我可以使用哪种Java API来构建简单的语音通信程序? - What kinds Java APIs can I use to build a simple voice communications program? 如何使用PFQueryViewController作为UITableViewController的子视图? - How can I use PFQueryViewController as a subview of UITableViewController? 如何编写一个简单的聊天机器人 AI? - How can I program a simple chat bot AI? 随着聊天的进行,如何使聊天程序向下滚动? - How do I make my chat program scroll down as the chat moves along? 如何让我的多线程服务器/客户端聊天程序使用 sockets 向所有客户端回显消息? - How do I get my multithreaded server/client chat program to echo messages to all clients using sockets? 其他计算机无法连接我的程序 - Other computers can't connect my program 我该如何使用FlatList而不是ListView? - How can I use this with FlatList not with ListView?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM