AIML loading functions
Contains contains the functions for the actual loading of AIML.
The general preferences and database details.
Write the substitution include file
Write the substitution arrays back into the subs.inc
Checks if a bot already exists.
Does a check to see if a bot with a particular name already exists. The reliance on unique names if crucial for the bot to work.
Add slashes for replacement purposes
Making a string safe to preform a replacement function on.
Add slashes for database query purpose
Making a string safe to put the text in an SQL query.
Create the object for writing the substitution include file
Creates the object, which is then used by addtosubs() to write to
Deletes everything about a bot.
Empties the tables, bot, patterns, templates, bots and gmcache
Deletes information about a bot in the cache and bot tables.
Used by the incremental bot loader program so it doesn't wipe out the whole bot on each aiml file load. Deletes everything in bot, bots and gmcache tables.
Used by the AIML XML parser
Looks for the end tags of 'topic' and 'category'.
Called by the XML parser that is parsing the startup.xml file.
Find a word in the patterns table given the word and the parent.
The AIML patterns are stored in the MySQL table in a binary tree format. This function retrieves the next word details based upon the previous' word's ID. If this word doesn't exist it returns 0, else it returns it's details.
Find a wildcard in the patterns table given the word and the parent.
Similar as findwordid() but this will retrieve the ID if there is a wildcard that fits.
Deletes the gmcache table.
This needs to be called whenever the patterns or templates table is updated.
Gets the ID of a bot given its name.
Gets the ID of a bot given its name
The name of the bot
@ return integer The bot's ID.
Gets a bot's property value.
Retrieves the value of a particular bot predicate. If the predicate isn't set, then it will return the value 'default'. This has been hardcoded
Part of the AIML XML parser.
Checks for start tags of pattern, topic, that, template and CDATA
Process contents <learn> tag in startup.xml
Called by the XML parser that is parsing the startup.xml file. * -> all files in directory, or single file.
Inserts the pattern into the patterns table.
inserts the pattern, that and topic as individual words in binary tree format into the patterns table
Inserts a template into the template table.
Insert the template into the template database.
This version has been adapted to also insert the pattern, that and topic into the additionally added columns
Inserts an entry into the patterns table. Returns the ID of the new row inserted.
insert a word into the patterns table, returns the id of the record so it can be used as the parent ID of the next word that's to be inserted.
Learn an AIML file.
Learn a single AIML XML file. Again, the hardcoded time limit is set to 600, presumably seconds.
Learn all the files in a directory ending with ".aiml"
Read all the AIML filenames into the $learnfile Array. This array is then later on used by learn() in handlemeS()
Learn the AIML string.
XML parse the AIML string. It seems to have a hardcoded time limit of 600, presume seconds.
Load an AIML string that is just a category.
This is going to need to take bot as a parameter
Load an AIML string. String must be valid XML.
This is going to need to take bot as a parameter
Parses startup.xml
Loads the startup.xml in the botloading process. XML parses the startup.xml file.
Parses startup.xml if the bot is loaded incrementally - one file at a time.
Parses the startup.xml if the bot id loaded incrementally. One file at a time. This is very hacky and may not work properly.
Create the array PHP code for the sentence splitters
In AIML it is custom to return a reply for every sentence the user inputs. This means the sentence input needs to be split into individual sentences. However, some people find that the semi-colon should also be added, while others think it should. The user will define the sentence splitters in startup.xml and these will then be stored in a PHP file included by the application.
Creates the PHP array code for subs.inc.
Subs.inc contains PHP code written during the bot load process. This function creates the array PHP code and returns the code as a string.
Creates the subs.inc file.
Creates the subs.inc file and fills it with 5 arrays that correspond to the 4 substitution sections and sentence splitters.
Set an entry in the patterns table to not be flagged as the last word in its context.
Update a record in the patterns table, change isend column from 1 to 0. Given a particular word ID.
Retrieve timer data
Get the running time the timed script
Start a timer
Save the start time of the to be timed script
Stop a timer
Save the stop time of the to be timed script
Used by the AIML XML parser
Looks for the start tag used in AIML files for category, template, that, topic.
Called by the XML parser that is parsing the startup.xml file.
startS and endS are two functions that cooperate. startS looks for the start of an XML tag, endS for the end tag. It fills the global variabls with info to be processed further on. Inserts the bots into the bots table, inserts the bot predicates into its respective table.
Checks if a template exists for a given pattern
Does a query on the database to see if an ID is used by a template in the templates table.
Makes the keys of an array uppercase.
Makes the keys of an array uppercase.
Documentation generated on Wed, 12 Jan 2005 12:24:42 +0100 by phpDocumentor 1.3.0RC3