Reading out a file, Sentence code, More on names, Pattern Code, Short term memory (STM), Subject, word in input expected
Reading out a file If you have more than 255 chars in a line then you will cause a gpf in the Ai as the variable overflows. This has been left like this for now to enforce a limit on the size of the input, this will probably change when checks have been added to some of the translation routines to stop them from having a seizure.
Sentence code This routine assigns each word in the sentence with a mnemonic (a letter, number or other character). Words found in the first input file are assigned with a capitol letter e.g. E is the mnemonic for a question word, B is the mnemonic for a bad word. Lower case mnemonics are set by using the TF the number in field 4 in the TF is translated into the mnemonic. If a paten is found in the inputs received then the paten is written into the TF into field 6, thus when the paten is search for then the paten can produce a response or be used and processed by all the routines using the TF. The translation from the mnemonics is set at a low priority when the reply is being processed. This means that the answer from paten recognition is used when no more preset answer could be found. NOTE if the mnemonics are only made up from words in the firstinput i.e. nothing recognised in the TF then the answer suffers a delay. If nothing is found in the TF then the normal routine is bypassed and the answer is put into memory for processing by another routine, which may or may not send the response to the output depending on what else is going on with the inputs and outputs. The response acquires a weight which is balanced by other answers with the highest sent to the output this doesn't mean that the answer is lost as it may take precedence as other replies are used. When the data file loops then eventually the answer will be lost.
More on names (not finnished) If field 4 in TF is 23 then a Name has been found and the Name routines are used. Field 9=Name file usually .dat extension in ...\Ai\name\ folder, 7=response 10=name type i.e. student. If the name type is student then the student routine is used. This routine at this time has 3 sub commands, which can be used to create lessons MESSAGEBOX: opens a message box with this text AIOUTPUT: sends words to the Ai output AUTOIT: name of script to run in ...\Ai\scripts\ opens an Auto It script, which can do many things, see the Auto It help file in the data folder see below for more on Auto It and how it is used by the Ai
Patten Code After the Ai has translated the input and got as far as the end of Creat A Reply routine if it still has no answer then it goes into the next stages the first being Patten recognition. This uses other varables to create answers depending on what patterns have been found in the sentence field. A patten is defined by field 4=60, if so then the Patten routine uses fields 7,8,9 and 11 in its own uniuqe way the output uses the values to create the output structure. Field 7=first part of output 8=second part 9=used if not enough information ie. No verbs or nouns found. Field 11 controls which word type is used in the answer If 11=2 use the noun and what's in that words field 11 If 11=3 use the Adjectiv If 11=4 use the verb and what's in the verbs field 11 If 11=5 use the Adverb If 11=2+4 use the noun and the verb that are in the sentence If 11=40 then the words after the pattern words are sent to the output If 11=70 then field 10 followed by the words after the found pattern are sent to the AiBrowser program which if not running should run and load the address into the URL bar and attempt to navigate to the website eg. 4=60, 6=_¡e (pattern),10=http://www.google.co.uk/search?hl=en&q= and 11=70 Input: "search google for lobsters" the found pattern is: _¡e which is "search google for" so http://www.google.co.uk/search?hl=en&q=lobsters is sent to the URL bar which in turn is sent to the internet and should inichiate a google search for lobsters returning the websites found if 11=test then "test found in 11" is sent to the output if 11=use5 then the contents of the patterns field 5 is sent to the output if 11=use6 then the contents of the patterns field 6 is sent to the output if 11=use7 then the contents of the patterns field 7 is sent to the output if 11=use8 then the contents of the patterns field 8 is sent to the output if 11=use9 then the contents of the patterns field 9 is sent to the output if 11=use10 then the contents of the patterns field 10 is sent to the output if 11=use12 then the contents of the patterns field 12 is sent to the output
Short term memory (STM) The STM is some times refered to as the Data Store. The length of the STM is set in the box called Learning file length in settings. The number is the number of previous inputs to remember and refer to when looking for repeat occourances of words when trying to work out what we are talking about. The word is first looked for using the Subject routine, if no match is found then the TF is searched. TF entries 35 to 38 are the various default outputs if nothing is in field 11 of the word found most in STM. If SKIP is in 11 then the word is ignored, if NoSTM is in 11 then the previous word is used. 35=STM noun 36=STM verb 37=Word found in STM and TF not a noun or verb 38=Word in STM but not in TF
Subject The Subject routine attempts to work out what subject the conversation is about. The most frequently found word in the STM is compaired against key words that define the subject. Field 9,10 and 11 hold the key words the words must have a space on either side this prevents words in the middle of the keywords being recognised. There are 60 subjects, fields 40 to 100 TF are used for subjects field 40 is the 'no subject set' response. Each subject is set by keywords that are in fields 9,10,11. If the most frequent word in the STM is found to be a subject keyword then the subject variable is set to the response in field 8. Field 7 holds a command word that in certian circumstances is fed back into the input. This happens when there is no other output or the output is repeated. The command word could be used to read a file into the input that is about the subject. If the phrase in 7 has one of the keywords in it then a feed back loop will be created.
word in input expected The routine looks for words in the input that it is wating for ie an answer to a question set from a previous sentence/input. Fields 8 and 9 hold the two words and depending on which words are found then the response is in 10 and 11. 10 is the response if word in 8 is found and 11 is the response if the word in 9 is found. If field 4 is set to 68 then the response is put into the input, if field 4 is 69 then the response is sent to the output. Field 2 in Entry 11 TF is the number of times to keep asking for the word before giving up Field 11 is the "I give up phrase".
Autoexec When the program starts the Ai reads endtry 14 TF. It is usually called autoexec. Field 8 is put into the input. Field 1 controls how subsquant inputs are translated this should bet set at 0 unless you want all inputs translated in a different mode. Mode switches can still occure during translation.

 


Ai Help