Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Don Ferguson

Pages: [1] 2
1
Ultra Hal 7.0 / Download: Haptek Character "Sonia"
« on: February 23, 2005, 10:17:01 pm »
Hello,

I've received some phone calls and e-mails from various individuals who heard that I had an additional Haptek character for Ultra Hal.

The character is named "Sonia," and she's Margene's blonde sister.  She was created at the same time as Margene, but space didn't allow including her as an original character.

VonSmith was kind enough to create the accompanying "preview" and "startup" .jpg files for Sonia.  However, when I went to post the three Sonia files to this forum many months ago, I discovered that they exceeded the file size limit.

To get around this, I have posted the three Sonia files to one of the pages on my website.  You can download them at the following url:

www.cortrapar.com/sonia.htm

I apologize for the delay.  I hope you enjoy Margene's sister, Sonia.

Sincerely,

Don

2
Hello,

Our forum software is apparently unable to register new forum members at the moment.  Mr. Bill Peck e-mailed the following inquiry from the United Kingdom, and asked me to post it here for him:

--------

SAPI 5 Text to Speech engines such as Hal's will speak in real time text that has been copied to the clipboard.

How do I get the Haptek Player in Hal or PeoplePutty to mouth the audio thus produced?

I could write a Theatre Script in PeoplePutty, but that all has to be preprepared. I want the flexibility and speed to control the Haptar with the 'copy to clipboard' function just as I can with Text to Speech.

Many thanks,

Bill Peck

----------

I hope that several of us can answer Bill's question, and hopefully, he will soon be able to join the forum!

Thank you and best wishes for the New Year,

Don

3
Hello,

I've received some inquiries looking for the "Blank Slate" brain posted elsewhere on this forum (in another thread).

The brain is posted here so that it can be easily found.

The "Blank Slate Brain" allows you to create a complete new personality for Ultra Hal with a complete new set of remarks.  The character that you create will NOT interact in any way, or interfere in any way, with any of your other characters, other brains, or other data files.

Here are the properties of the "Blank Slate Brain":

1. This brain has the absolute minimum functions. It does NOT do jokes, greetings, insults, goodbyes, trivia, capitals, math, dates, etc., etc. It is designed to know AS LITTLE AS POSSIBLE until it talks with you.

2. It only writes and reads to one database, "blankslate.brn."

3. It associates each remark YOU make to the PREVIOUS remark that IT made. It knows essentially nothing until you begin talking to it and tell it something.

4. If it doesn't find anything in its memory, it simply poses your statement back to you as a question, and learns from your next response.

5. If you know how to edit databases, you will find that you can easily edit its database.

6. Because the script for this brain is only 241 lines long, and it has a small database, response time is practically instantaneous.

7. Because this brain has no prior knowledge, its quality is 100% dependent upon YOU. This brain is capable of uncanny accuracy, BUT it depends completely on YOUR remarks and behavior.

Best wishes to all users and programmers!

Have a great day!

Sincerely,

Don

P.S.  To install this brain, right-click the download, and choose "SAVE TARGET AS." Save it to this directory/folder path on your computer:

C:/Program Files/Zabaware/Ultra Hal Assistant 5

(Remember, our forum software can't display backslashes, so we use forward slashes instead. Your computer directory/folder path should show backslashes as usual.)

The next time you freshly open Ultra Hal, this new brain should show up on the options - brains menu. Select it, and you're off and running!

Download Attachment: Blank Slate Brain.uhp
10.45 KB

4
Hello,

We've had many postings about adapting Hal's script to operate in Spanish, French, German, etc.  Below, please find an adaptation of a response I wrote on the "Assistant" forum.  

I hope the information it provides will help some of us when coding for non-English:

-----------------

Hal is inherently capable of learning any language that uses the same alphabet as English. This is because Hal learns new words as letter-patterns and associates them with context.

For instance, if you consistently speak Spanish to Hal, he will at first answer you in English, but he will gradually pick up more and more Spanish and will start answering you in Spanish. It will take a long time, but it will happen.

HOWEVER, there are some "special" functions in the main control script that are definitely English-specific. The most important of these is the PRONOUN REVERSAL routine!

It would be possible to write a pronoun-reversal routine for Spanish and other languages, and add them to the substitutions.brn, where much of Hal's pronoun-reversal work is now located. The reversals could simply be added to the database; they would not interfere with the English reversals in any way.

I am not familiar enough with Spanish, French, German, etc., grammar to write the pronoun-reversals, but I know that it is feasible.

In case anybody reading this understands Hal fairly well, and also understands grammar and pronouns in a non-English language, let me explain some very important "tricks" in writing a pronoun reversal routine:

FACTS, TIPS, TRICKS ABOUT THE PRONOUN REVERSAL ROUTINE

1. Substitutions.brn consists of pairs of words or phrases. On each line, the ones on the left get removed from the user's sentence, and the ones on the right get substituted in their place.

2. The substitutions are processed in sequence from the first line at the top, to the last line at the bottom, so sequence does make a difference.

3. It DOES NOT WORK to simply substitute (for example) "yours" into "mine" and then later "mine" into "yours". Why not? Because the reversals are mirror images of each other, a simple-symmetrical routine would result in ALWAYS choosing "yours", since that's the last substitution that's done.

4. The solution? Two-step processing! We create some non-words as "temporary holding words" until we're ready to finish the reversals. That way, we don't accidentally "un-reverse" things after we reverse them the first time!

5. Here is an example of how it works:

" mine " becomes " zmineq "
" yours " becomes " zyoursq "

(The "intermediate words" can be any arbitrary patterns, as long as we choose carefully so that they are NOT "real words". Now we can finish the reversals without confusion:)

" zmineq " becomes " yours "
" zyoursq " becomes " mine "

...and via this two-stage process, we can reverse mirror-images of each other, without getting them mixed up! (NOTE THAT we put leading and trailing spaces inside the string-matching quotation marks, so we search for stand-alone words, not fragments of words that happen to contain the same letters!)

6. As a special problem, in English, we have the issue that "you" reverses to "I" when a subject, but reverses to "me" when an object, as in:

"You like to hit the ball when it's pitched to you."

--Correctly reverses as follows:

"I like to hit the ball when it's pitched to me."

If you look in substitutions.brn, you can see how this problem is solved for Hal in English. Essentially, it is a list of every transitive verb and preposition that we could think of, that would make "I" change into "me"!

NOW -- BACK TO THE QUESTION ABOUT NON-ENGLISH LANGUAGES -- There is no mystery how to do this routine, but I don't have the knowledge of other languages to correctly write the pronoun reversals, and I don't know the various grammar rules to know if there are issues in other languages similar to "I" versus "me".

If there is someone out there who combines the needed Spanish or French or German or other-language knowledge with the needed Ultra Hal knowledge, you would do all of us a great service if you could help us out with non-English pronoun reversals!

As I mentioned, these reversals could be added to the substitutions.brn without interfering with anything else that Hal does!

With pronoun reversals, Hal would have quite a bit of the capability in other languages that he has in English!

In the meantime, Hal can "learn" and respond in other languages that use the 26-character alphabet, but he won't have the pronoun reversals until we work together on this!

I hope that this is useful information for all interested parties.

Sincerely,

Don

5
Hello,

In response to previous posts and folks who have contacted me via e-mail, I thought I'd share this with you:

Wal-Mart is selling a five-foot-tall talking animated Santa for $59.  The advertisement claims that the audio-animatronic figure will move its lips and mouth to ANY audio source including a stereo and/or a microphone.

Obviously this means that UltraHal could operate this Santa figure.  With the appropriate knowledge database, UltraHal could carry on intelligent conversations through this five-foot-tall audio-animatronic character!

This is very tempting, even though I had never considered Santa Claus as the first full-size character to be driven by Ultra-Hal.  The tempting part is the factory-ready lip-sync capability, and the low, low price.

If anybody has checked this out, or owns one, please post a report and let us know how this works!

I'm posting the Wal-Mart link which includes photographs and a narrative description.

The link is as follows:

http://www.walmart.com/catalog/product.gsp?product_id=2365706#long_descr

Sincerely,

Don

6
Programming using the Ultra Hal Brain Editor / Capitalizing Proper Names
« on: October 25, 2003, 10:51:38 pm »
Question:

How does Ultra Hal know how to capitalize the names of people and places?  He seems to get many of them right, but he doesn't capitalize some of the names that he has learned from me.  How can I get him to capitalize the words that I want him to?

Answer:

Hal has a special database that covers this issue (and performs some other functions).  It is called the "corrections.brn" database.

The full "file path" looks something like as follows:

C:/Program Files/Zabaware/Ultra Hal Assistant/DefBrain/corrections.brn

(We use "forward slashes" here because the forum software can't display "back slashes.")

Your file path may be different, but you should be able to find it with any word processor.

Look inside the brain and you will find entries such as the following:

" canadian "," Canadian "
" chinese "," Chinese "
" china "," China "
" columbian "," Columbian "
" columbia "," Columbia "
" english "," English "
" england "," England "
" french "," French "
" france "," France "

When UltraHal has selected a response for the user, he checks this database and will substitute any perfect character-matches he finds within quotation marks on the left, with the characters within quotation marks on the right (spaces are significant).

Any pairs that you add to this database will result in items on the left being replaced with items on the right in Ultra Hal's responses.

So, this is the place to add proper names of people and places that you always want capitalized.  Suppose we had a friend named "Francis" and Hal wasn't capitalizing the name in the response.  We can just insert a line into this database as follows:

" francis "," Francis "

And Hal will always capitalize Francis' name!

BE CAREFUL about using spaces; if you leave them out, Hal will consider a match even if it's in the middle of a longer word, and might put a capital letter in the middle of a word somewhere!

For instance, if we say this:

" bob "," Bob "

...we will only capitalize the name "Bob" but if we say this:

"bob","Bob"

...it will cause Hal to make strange capitalizations such as:

The carpenter found the level using a plumbBob and a string.
The sewing machine needed a new Bobbin.

You can also use this database to make global, permanent corrections to words that you have misspelled in Hal's database.  Suppose that you had incorrectly used a double "l" in "eliminate," spelling it as "elliminate" and now Hal has picked up on it.  

You could do a global permanent fix by doing the following:

" elliminate "," eliminate "

Now, suppose that you considered the term "blockhead" to be particularly offensive, and you would always like UltraHal to substitute the word "fool" instead.  You could write this:

" blockhead "," fool "

...and Hal would never say the word "blockhead" again!

Please note that this database does NOT change the contents of any of the other databases; the substitutions occur "live" on each exchange, before the output goes to the screen and the speakers.

Hopefully this feature will be useful to you!

Sincerely,

Don

7
Hello,

Many of you have posted sources for AI robot parts and kits.  I also keep searching for good links, and I have found a site that is new to me, and it is HUGE!

A web-site called "Android World" offers scores of photographs and articles about currently-available robots, humanoid and otherwise.  The site is unusual and entertaining.

Apparently a fully-functional humanoid robot will set you back between $60,000 and $1,000,000.  But for the rest of us, they also have lots of less-expensive gizmos, parts, software, and info.

Here is the link:

http://www.androidworld.com

I am a bit disappointed that I didn't see a link to Ultra-Hal on their site... but who knows, it might be there in the future!  It looks as if many of the robots could benefit from "Conversational Capability by Zabaware!"

A sub-link on the above site will take you to Florida Robotics:

http://www.floridarobotics.com/ursula.htm

Enjoy the many, many links from the above sites, and please post your observations!

Sincerely,

Don

8
Hello,

I am attaching a new enhanced brain for Hal 5.0.  I've shown this to Robert Medeksza, and hopefully he will help me post it to the new "download plug-ins" page.  If you have Hal 5, you can preview it in the meantime.

The special feature of this new brain is the ability to self-identify new topic databases, and self-generate new files for new auto-focus topics.  The new brain does this as follows:

1.  Hal already has a routine that detects and databases one and two-word phrases that are the subjects of sentences.  These become candidates for possible new auto-topic database files.

2.  A new "Auto-Topic" routine detects the second recurrence of a word phrase that has been the previous subject of a sentence.  The routine then either creates a new pair of database files, or (if the file already exist) appends to those files.  The one file is an "associative" (Q&A) database, and the other is a "random" database.

3.  The new "associative" database files will appear in Hal's default folder with "AFA_" prefixes so that you can easily see them.  They will self-generate with names such as:

AFA_WORLD.brn
AFA_BIG DOGS.brn
AFA_SPORTS CARS,brn
AFA_CREATIVE PEOPLE.brn

4.  The new "random" database files will appear with "AFR_" prefixes so that you can also find and see them easily, with names such as:

AFR_WORLD.brn
AFR_BIG DOGS.brn
AFR_SPORTS CARS.brn
AFR_CREATIVE PEOPLE.brn

5.  How does Hal use these new databases?  Well, he has a new response routine which checks to see if an auto-topic subject database is available.  If so (and if he hasn't already found an answer from earlier in the script), he uses the new automatically-generated auto-topic database to get a response.

6.  As you talk to Hal about a wide variety of subjects, the population of these little auto-topic databases grows and grows.  Each one is small and quick to access, so they don't slow Hal down.  They are also very easy to view and edit for advanced users.

7.  The power of this approach is two-fold:

a) When Hal uses an auto-topic database, his response will seem much more "on topic."

b) Because the data is distributed over many different files, Hal is leveraging the computer's file system for speed.  If Hal had a million responses in a big database, he would have to search the entire million every time.  In contrast, if he had 1,000 mini-databases with 1,000 entries each (which is of course a million), Hal would only have to choose among the 1,000 files, then among the 1,000 entries.  Thus, you get the power of a million, but only the search time of 2,000!

I have annotated the "auto-focus" sections fairly heavily, and labeled the two sections (the response section and the save section).  I would really appreciate it if some of you advanced users, programmers, and developers would examine the code and try it out!  If you want to examine the new code sections, open the new script in a word processor, and "search" on "auto-topic".  Enjoy!

(Remember, the "topic phrase" must be the subject of a sentence before it is a candidate for an "auto-topic" subject.  For instance, if you say, "Programmers are hard working," the word "programmers" becomes a candidate for a future database name.  However, once a database has been started, ANY instance of that word at ANY location in a sentence can cause that sentence to get appended into the so-named databases.  These new databases cause Hal to get smarter GRADUALLY, so please be patient with him!)

Thanks, and have a great day!

Sincerely,

Don

Download Attachment: hal5d.uhp
152.19 KB

9
Hello,

This is for Larry and others who inquired about "Script Level Scope Variants." I wrote a quick demo brain to see if string variants would stay in memory between conversational exchanges.

It does seem to work for strings as well as for numbers.

The attached demo brain interviews the user as to his or her favorite color, activity, location, and fragrance.  These four items are "saved" as "script-level scope variants" and reported back to the user all at once in the demo conversation (then Hal erases the information and starts the demo over again).

I definitely DO NOT know if there are any undesirable side effects to using "script-level-scope" variants this way; I am only testing to see if they work as we have discussed elsewhere on the forum.

My sense is that we are probably safest using Robert Medeksza's CustomMem routine, since we have a body of experience that it works under all conditions and environments.

Sincerely,

Don


Download Attachment: Demo Brain for Script Level Scope Variants.uhp
13.9 KB

10
Ultra Hal Assistant File Sharing Area / Download This Demo Trivia Quiz Brain
« on: September 29, 2003, 09:19:25 pm »
Hello,

The purpose of this demo brain is to show how Zabaware's "topic" tags with delayed-response feature works, and also to show how correct quiz answers can be detected and scored.

Hal asks random questions from a pool of questions about United States history.  

Hal detects whether the user gets the right answer.  As the quiz proceeds, Hal keeps track of the correct answers and the number of rounds, and says the running score to the user.

This is kept to a pool of only ten questions for demo purposes -- I expect that you can write much more imaginative trivia quizzes by modifying and expanding this brain!  

The code patterns to accomplish the job are annotated and hopefully they will make sense to you!

Best wishes to all programmers, and have a great day!

Don

P.S.:  To download and install, right-click on the download below, choose SAVE TARGET AS, and save the file into the following directory/folder path on your local computer:

C:/Program Files/Zabaware/Ultra Hal Assistant 5

(Note that our forum software cannot display backslashes, but the forward slashes above are supposed to represent backslashes.)

The next time that you freshly start Hal, you should be able to find this brain when you choose OPTIONS, BRAIN.

Select this brain and you should be up and running.


Download Attachment: Trivia Quiz Demo Brain.uhp
15.4 KB

11
Ultra Hal Assistant File Sharing Area / Download This DateDiff Demo Brain
« on: September 29, 2003, 10:51:41 am »
Hello,

The "DateDiff" function in VBS allows you to calculate the difference between any two valid date strings, and return the answer in units of quarters, months, weeks, days, hours, minutes, or even seconds!

This is in response to a request for a "timer" that would measure the time since the last user response, even if the last response was days ago (the computer must be running during that time of course).

The demo file shows the code to use the "DateDiff" function; Hal simply states the time in seconds since the last time that you said anything.

The demo code in the script that makes this happen should be pretty much self explanatory.

I hope that this is of some interest and value to you.

Sincerely,

Don

Download Attachment: Date Difference Demo Code Brain.uhp
12.08 KB

12
Hello,

The Hal Brains can be used to create mystery interview games.  

In this simple demo, Hal has lost his wristwatch. You can interview Hal to cause him to figure out where he left it.

Once you see the logic of the attached script, you will be able to write much better mysteries for users to solve than the one shown here!

Best wishes to all programmers!

Sincerely,

Don

P.S.  To download and install, right-click on the download below, choose SAVE TARGET AS, and save the file into the following directory/folder path on your local computer:

C:/Program Files/Zabaware/Ultra Hal Assistant 5

(Note that our forum software cannot display backslashes, but the forward slashes above are supposed to represent backslashes.)

The next time that you freshly start Hal, you should be able to find this brain when you choose OPTIONS, BRAIN.

Select this brain and you should be up and running.


Download Attachment: Mystery Game Demo Hal 4 and 5.uhp
17.17 KB

13
Hello,

I've had a few reports of folks having error codes and no luck trying to use the CustomMem encode/decode routine that Robert Medeksza wrote some time ago.  

His routine allows you to take ANY NUMBER of variables, and encode them into the CustomMem variant for remembering between conversational exchanges, and then decode them and get them all back as individual variables again.  This means that you have an unlimited number of "memory banks" that can remember from one conversational exchange to the next.

I suspect that possibly folks who are having problems might not have the required extra functions at the very end of the script in order for it to work. (I don't know -- this is just a guess.)  In the attached demo brain, these functions are flagged and annotated and shown in the correct place in the script.

The attached script does the following:

1.  It initializes on your first exchange by randomly selecting four numbers between 0 and 100.  

2.  On each subsequent conversational exchange, Hal "remembers" the four numbers and says them to you, along with the current date and time. He is "remembering" the numbers because they are being encoded and saved to CustomMem, then decoded and retrieved from CustomMem on the next round.

3.  You can look at the script and see exactly how the encoding and the decoding work.  You can then apply the pattern to your own programming, with unlimited numbers of variants.

4.  Don't forget to study the functions that Robert Medeksza wrote for the very end of the script!  This routine does NOT work without them!

I hope that this demo brain is interesting and helpful to several of you programmers!

Thanks!

Don

Download Attachment: CustomMem Demo Brain Hal 4 and 5.uhp
14.41 KB

14
Hello,

I've noticed a lot of us are writing experimental code, and we need a place to test that code.

I've taken the Hal 5.0 brain and REMOVED every routine possible to make it close to a "pure" experimental environment.  

NOTE: I've only tested this with the Hal 5 Beta engine.  If you don't have the Hal 5 Beta program, it's available on the Beta forum, which is ONLY VISIBLE WHEN YOU ARE LOGGED ON WITH A USERNAME AND A PASSWORD ON THIS FORUM.

The attached HalBrain file will only reverse the pronouns and repeat back the user's statement, except automatic .dll functions and any experimental code that you place in a plainly designated area.

This could be very useful for you programmers and code experimenters!

Put this brain file into the same folder as your existing Hal5.uhp brain.  You should then see the Experimental Brain in Hal's menu on your next start up.

Instructions to write experimental routines are written in the opening commentary in the brain, when you open it and read it on a word processor.  A sample of an experimental routine is located in the "experimental area" and you can erase that routine without any harm, replacing it with your own.

Remember, the point of this brain is to be as SIMPLE and as BLANK as possible to give you a place to experiment!

REVISION NOTE: AN "EXPERIMENTER'S BRAIN" THAT IS COMPATIBLE WITH BOTH HAL 4 AND 5 IS NOW POSTED SEVERAL MESSAGES BELOW -- DON

I hope this helps!

Sincerely,

Don

Download Attachment: Experimenter hal5x.uhp
12.24 KB

15
Question:  Can I edit Hal's database files on a text editor?  What do the different patterns in the database files mean?  

Answer:  UltraHal's brain-editing software was developed to reduce the potential of corrupting these files.  However, if you study and are very careful, it is possible to directly edit Hal's database files on a text editor or word processor.  

Turn off auto-correct, spell-check, grammar-check, and other gizmos that might confuse you or cause you to make entries without realizing it.  Have your computer set to show the file-extensions of files, not hide them.  Always make a back-up copy to a different folder before you start, so you can restore the file as it was originally if you make a mistake!

There are two major exceptions to self-editing Hal's files:

1.  The editing of Hal's .dll files is NOT recommended, except for extremely advanced programmers with all the appropriate programming software and training.

2.  User editing of Hal's largest database file, "mainbrain.brn," is no longer possible because it is semi-compiled at Zabaware to speed it up.  This means that the file contains internal cross-references for speed, and it will not work if sections of it get changed.

The information below pertains to editing various ".brn" files.  UltraHal's different "brain" database files have ".brn" file extensions.  The various kinds of files have different data formats.  Here are the most common ones, with advice on each:

RANDOM ENTRY DATABASE FILES

The "random" files simply have words, phrases, or sentences with a line break introducing each one. They often have the word "random" in their names, but some random files have other names, such as "Topic.brn". As the name implies, Hal accesses the file from an external trigger-routine and picks one of the entries at random.

Go into a "random" file with a text editor and the files look like this:

Horses are fine animals.
All mares were once fillies.
Horses need food and exercise.
Meteorites are meteors that struck the ground.
It would be fun to touch a meteorite.

Some entries in random files have a special feature.  They have a flag which holds back part of the entry so that Hal can tell a riddle on one exchange, and the answer on the next.  These can be used for any remark in which we want Hal to "hold back" part two of a message.  These entries look like this:

Why does the chicken cross the road?<TOPIC>Perhaps it's only knowable to a chicken.</TOPIC>
What do you do for a living?<TOPIC>My job is right here with you.</TOPIC>
What is your hobby?<TOPIC>My hobby is chatting.</TOPIC>
I can read your mind.<TOPIC>Right now you are thinking that I can't read your mind.</TOPIC>

It is entirely feasible to write, edit, and add to any and all of the "random" files on any text editor.  It is not likely that you will hurt them.   Do not add blank lines, since they might be selected randomly as responses.

ASSOCIATIVE DATABASE FILES (ALSO CALLED "Q AND A" FILES)

The "associative" files have words, phrases, or sentences in a specific paired-relationship, which is as follows:

@This would be a sentence that Hal might speak about penguins.
THESE WORDS ABOUT PENGUINS MIGHT TRIGGER HAL TO SPEAK THE ABOVE
@Here is another sentence about airplanes that Hal might speak.
WORDS ABOUT AIRPLANES THAT MIGHT TRIGGER HAL TO SPEAK THE ABOVE
@Airplanes are fun to ride on!
GOING PLANE TRIP SOON
@Everybody needs a vacation!
GOING VACATION SOON

(There should be an "@" sign at the beginning of each of the sentence-case sentences above, and each of the ALL-CAPS sentences should begin with one blank space. This forum program removes leading spaces, so we can't show them.)

Notice that in the "associative" files, the potential response sentence is always first, following the "@" sign, and the corresponding user words that might trigger Hal follow.  Also note that the "trigger" lines in caps do not need to be complete sentences.  Compete sentences will work, but so will phrases, sentence fragements, and individual words, depending on what you are trying to associate with the response.

Hal automatically builds these associative databases, relating the user's current statement to Hal's previous statement, and/or to the words in the user's current statement. Some routines add full sentences as triggers, and some routines only use "key words" as triggers.

When Hal uses an associative database, he scans the entire file, evaluates the number of relevant trigger words, the sequence of the trigger words, and selects the match that gets the highest score. If Hal uses the file twice in a row, he randomly selects another close match from the entire file.

Associative files make Hal very powerful because they do NOT require precise matches to work.  As Hal's associative files become more "populated", Hal gets smarter.  Many of Hal's most uncanny and unexpected responses can be generated from these files!

It is possible to write and edit the associative files on any text editor, as long as you maintain the paired-relationship pattern, and don't begin or end the file with any extra line breaks (that would corrupt the file).

Finally, we have...

SPECIFIC RECALL DATABASE FILES (LITERAL STRING-MATCH FILES)

By far the most complicated Hal database format is the specific-recall files. The specific-recall files use literal string matching.  Literal string matching is used by simpler chatterbots, but Hal's are much more complicated.  For instance, the Enhanced_Main.brn file is a specific-recall file.

Hal stores trigger phrases in the specific-recall files, and if an exact character match occurs for one of those phrases, Hal will respond.

Each entry after a line-break in a specific-recall database as actually an "array," which is a set of different items (or "arguments") set apart by commas, which a function can understand and use.

Here is a special annotated example of Hal's specific-recall arrays:

" 1ST TRIGGER PHRASE (REQUIRED) "," OPTIONAL SECOND TRIGGER PHRASE (IF USED, BOTH TRIGGER PHRASES MUST BE FOUND) "," OPTIONAL PHRASE TO CANCEL TRIGGER "," First of three possible Hal responses (required entry). "," Optional second of three possible Hal responses. "," Optional third of three possible Hal responses. ",2,#FALSE#,#FALSE#," Optional additional response words. "

Note that the quotation marks and commas are critical!  If they are missing or out of place, the file will not work!

Here is another example:

" PRETTY "," POODLE "," MIXED BREED "," I like poodles; they're cute; "," Poodle grooming costs money; "," My neighbor has a poodle; ",1,#FALSE#,#FALSE#," "

If the user says, "I have a poodle," this entry returns nothing because both PRETTY and POODLE must be found.

If the user says, "I have a pretty mixed breed poodle," Hal still doesn't trigger because MIXED BREED cancels the call.

If the user says, "I keep my pretty toy poodle in the basement," Hal answers with one of the three phrases.

In the specific-recall databases, the arrays are each separated by a line break. It is possible to write and edit these files on any text editor, but the exact pattern of the arrays MUST be maintained or the file becomes corrupted and unusable!  In the specific-recall brain files, the EXACT usage and number of commas and quotation marks must be maintained!

Also, do not add blank lines to this file.

For those of you who strongly desire to edit the files directly, I hope this is helpful to you!  Back up files and back up often!

P.S. Hal's new versions now have many additional "specialty files" for storing words and phrases. Many of these files have their own unique formats.  If you have a specific question about one of the "specialty files," I will try to answer it.

Sincerely,

Don


Pages: [1] 2