Public Member Functions | |
cInterpreter (void) | |
Initializes everything. | |
virtual | ~cInterpreter (void) |
Deinitialize the core. | |
virtual bool | initialize (const std::string &filename)=0 |
Initialize the AIML core using configuration file. | |
virtual bool | initialize (const std::string &filename, const cCoreOptions &opts)=0 |
Initialize the AIML core using data passed from client program. | |
virtual void | deinitialize (void)=0 |
Deinitialize the core. | |
virtual void | registerCallbacks (cInterpreterCallbacks *callbacks)=0 |
Register callbacks for libaiml to use. | |
virtual bool | respond (const std::string &input, const std::string &username, std::string &output, std::list< cMatchLog > *log=NULL)=0 |
responder function. | |
virtual void | unregisterUser (const std::string &username)=0 |
Removes a user from the list in memory. | |
virtual bool | learnFile (const std::string &filename)=0 |
loads an .aiml file. | |
virtual bool | saveGraphmaster (const std::string &file)=0 |
Saves currently loaded graphmaster into a .caiml file. | |
virtual bool | loadGraphmaster (const std::string &file)=0 |
Loads a previously saved .caiml file into the core. | |
AIMLError | getError (void) |
Get the last error set. | |
virtual std::string | getErrorStr (AIMLError error_num)=0 |
get the last error code generated in humanly readable form. | |
virtual std::string | getRuntimeErrorStr (void)=0 |
returns the last runtime error message set by the corresponding subsystem. | |
Static Public Member Functions | |
static cInterpreter * | newInterpreter (void) |
Create a new interpreter instance. | |
static void | freeInterpreter (cInterpreter *i) |
Destroy a cInterpreter object. | |
Protected Attributes | |
AIMLError | last_error |
cInterpreterCallbacks * | callbacks |
This is the class to be used as the interface. It encapsulates the libaiml interpreter.
|
Deinitialize the core. Calls deinitialize(). |
|
Initialize the AIML core using configuration file.
|
|
Initialize the AIML core using data passed from client program.
|
|
Deinitialize the core. Saves all user variables into the user's files and shuts everything down. You don't have to call this explicitly, the destructor does it. |
|
responder function. The output is touched iif the function returns true. The username will be created if this function is called for the first time with such parameter. The matching & response will be done inside the user's context. If the log parameter is used, it is used to store each of the matches made by the interpreter to reach the template. It is a list because it includes the top-level match and any possible internal <srai> matches made later.
|
|
Removes a user from the list in memory.
|
|
loads an .aiml file.
|
|
Saves currently loaded graphmaster into a .caiml file.
|
|
Loads a previously saved .caiml file into the core. This functions replaces the content of the graphmaster completely, so if you want to mix aiml files and ONE .caiml file (more wouldn't make sense), you should load all .aiml files first.
|
|
get the last error code generated in humanly readable form.
|
|
returns the last runtime error message set by the corresponding subsystem.
|
|
Create a new interpreter instance. This is necessary because cInterpreter is an abstract interface, you couldn't build the interpreter yourself without seeing the implementation. The data returned is dynamically allocated with 'new', so you can call destroy on it afterwards.
|
|
Destroy a cInterpreter object. You don't need to use this as you can just do 'delete i;'. This function is just defined for simmetry. |