⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kernel.h

📁 J-Alice是一个用C++实现的Ailcebot的克隆。它可以做为一个mini-http服务器在控制台或irc聊天。目前
💻 H
字号:
/**
 * Kernel - Brains of the operation
 *
 * @author	Jonathan Roewen
 */
#ifndef KERNEL_H
#define KERNEL_H

#include <string>

using namespace std;

#include "Element.h"	//	?

#define	LOOP_EXCEPTION	0001
#define MATCH_EXCEPTION	0002

class Match;
class Responder;
class Nodemaster;
class StringTokenizer;

class Kernel
{
public:
	Kernel();

	static string bootstrap();
	static void load(const string &file);
	static void load10(const string &file, PElement &root);
	static void loadSubstitutions();
	static Nodemaster * add(const string &pattern, const string &that, const string &topic);
	static Nodemaster *add(const string &sentence, Nodemaster *parent);
	static Nodemaster *add(StringTokenizer &st, Nodemaster *parent, int count, const string &sentence);
	static Match *match(const string &input, const string &that, const string &topic);
	static Match *match(Nodemaster *node, Nodemaster *parent, int state, const string &input, const string &star, const string &path);
	static string process(Match *m, PElement e, Responder *, const string &id);
	static string respond(const string &input, const string &id);
	static string respond(const string &input, const string &id, bool srai);
	static string respond(const string &input, const string &id, Responder *);
	static string respond(const string &input, const string &id, int depth, bool srai);
	static string respond(const string &input, const string &id, Responder *, int depth, bool srai);
	
	static void convertTempAiml();
private:
	static void addStar(Match *, const string &, int);
	static void addPath(Match *, const string &, int);
	static bool lookup(const string &, const string &);
	static void loadTemporaryData();
	
	static Nodemaster *root;
	static const int INPUT, THAT, TOPIC;
	static const string constants;
};

#endif 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -