File/respond.php

Description

Respond functions

Second layer functions that are prior to entering the AIML match routine.

Includes
 require_once ("admin/dbprefs.php") (line 37)

The general preferences and database details.

 require_once ("plugins/customtags.php") (line 52)

The file containing the function that process custom, non AIML 1.0.x specified, tags.

 require_once ("util.php") (line 47)

A collection of generally useful utility functions

 require_once ("graphnew.php") (line 42)

The matching engine functions of the AIML interpreter.

Functions
handlenode (line 388)

Handles the actual XML between the <template/> tags.

Recognises the different tags, access the different functions to process each individual tag. Notes by the original developer:
Why isn't this a huge switch statement? Because it has to do more comlicated checking than just string comparison to figure out what it should do.
How can I organize this better? Good question.

string handlenode (mixed $xmlnode, array $inputstar, array $thatstar, array $topicstar)
  • mixed $xmlnode: Getting either a string or an array from recursechildren() func.
  • array $inputstar: If a matched pattern includes *'s then what is covere by the * is found here.
  • array $thatstar: if a used that contains a star, then what is covered by the * is found here.
  • array $topicstar: if a used topic contains a star, then what is covered by the * is found here.
realchild (line 327)

Get the real XML child

Get the real XML child which is used for processing AIML tags that may contain other AIML tags, such as SRAI, CONDITION etc.

mixed realchild (mixed $xmlnode, array $xmlnode )
  • array $xmlnode
recursechildren (line 286)

Third level response processing

This function is the 'manager' function of the template processing.

string recursechildren (mixed $xmlnode, array $inputstar, array $thatstar, array $topicstar)
  • mixed $xmlnode: Getting either a string or an array from respond() func.
  • array $inputstar: If a matched pattern includes *'s then what is covere by the * is found here.
  • array $thatstar: if a used that contains a star, then what is covered by the * is found here.
  • array $topicstar: if a used topic contains a star, then what is covered by the * is found here.
reply (line 115)

Main container function in creating the bot's reply.

This function is the 'manager' of all the sub-funtions that do the real processing. It creates a class called Response that is used throughout the application.

object A reply (string $userinput, integer $uniqueid, [integer $bot = 1])
  • string $userinput: The user's input.
  • integer $uniqueid: The user's session ID.
  • integer $bot: The bot's ID.
replybotname (line 70)

Start function for retrieving bot reply

Checks to see if bot exists, if so calls reply() to get the repons to the user's input.

string replybotname (string $userinput, integer $uniqueid, [string $botname = "TestBot"])
  • string $userinput: The user's input
  • integer $uniqueid: The user's session ID
  • string $botname: The bot's name, if no name selected the default value is "TestBot".
respond (line 200)

This is the second level response function.

After reply() this function is the second level function to get the answer to the user's input.

void respond (string $sentence)
  • string $sentence:

    The sentence to be matched.

    #return string The response to the user's input.

Documentation generated on Wed, 12 Jan 2005 12:24:47 +0100 by phpDocumentor 1.3.0RC3