[英]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.