Zabaware Support Forums

Zabaware Forums => Ultra Hal 7.0 => Topic started by: vrossi on May 18, 2006, 06:12:11 pm

Title: Where is Seattle, Who was Galileo ?
Post by: vrossi on May 18, 2006, 06:12:11 pm
Another little bug in Hal 6, version 6.0.103.

Ask Hal: Who was Galileo? (or any other famous person)
Where is Seattle? (or any other city)

Hal will give a generic answer.

The first release of Hal6 had the same problem, which I pointed out to Robert (see http://www.zabaware.com/forum/topic.asp?TOPIC_ID=2624 )

Then Rob fixed it in the final Hal 6 version. Now he maybe forgot to set up the same fix in this new version.

However, anybody can easily fix it. Go to the brain editor (after backing it up) and around line 700 add the following lines:



(http://www.zabaware.com/forum/uploaded/vrossi/2006518175735_WordNetBug.jpg")






This is the result after this little brain surgery:

Vit: where is seattle
Pat: Seattle: a major port of entry and the largest city in Washington; located in west central Washington on the protected waters of Puget Sound with the snow-capped peaks of the Cascade Mountains and Mount Ranier visible to the south and east; an aerospace and computer center; site of the University of Washington.

Vit: who is galileo
Pat: Who is galileo? I'm thinking that it must have a good frame work. Galileo: Italian astronomer and mathematician who was the first to use a telescope to study the stars; demonstrated that different weights descend at the same rate; perfected the refracting telescope that enabled him to make many discoveries (1564-1642). Galileo Galilei.

Anyway, I hope Robert fix this (together with the other bug I described in http://www.zabaware.com/forum/topic.asp?TOPIC_ID=3264 ), in the next upgrade.


Title: Where is Seattle, Who was Galileo ?
Post by: markofkane on May 18, 2006, 06:27:23 pm
Mine works as is. But thanks!!!
Title: Where is Seattle, Who was Galileo ?
Post by: vrossi on May 19, 2006, 03:43:48 am
Really? Are you using the new version?
If yes, this means that something went wrong with my installation. Next week-end I will uninstall and reinstall everything and check again. In this case, sorry to everybody for posting about a non-existing bug.

Title: Where is Seattle, Who was Galileo ?
Post by: Art on May 19, 2006, 06:03:21 am
Vittorio,

I'm having the same problem and I installed the final version as did you.

Title: Where is Seattle, Who was Galileo ?
Post by: markofkane on May 19, 2006, 06:10:57 am
I am using 6.0.103.

I installed over the older version, I believe.

No problems so far!!

Edit: Now I know why. I wasn't using the default brain. I was using a custom brain from the previous version!!!

Yep, the bug lies in the default brain!!!

Thanks for alerting me to this!!!
Title: Where is Seattle, Who was Galileo ?
Post by: markofkane on May 19, 2006, 06:38:00 am
Brain Surgery completed. So far, no complications. Patient is now resting.
Title: Where is Seattle, Who was Galileo ?
Post by: markofkane on May 19, 2006, 06:43:07 am
Complications after brain surgery!! My custom brains do not work!! Blank responses!!!

Must revert back.
Title: Where is Seattle, Who was Galileo ?
Post by: vrossi on May 19, 2006, 07:51:14 am
quote:
I'm having the same problem and I installed the final version as did you.


Thank you, Art. So I can avoid spending my week-end time uninstalling and reinstalling Hal [:(]

I believe that when Robert created the 6.0.103 version, he started from a brain release which was not the last one, because this problem was already solved in 6.0.

markofkane

 
quote:
Complications after brain surgery!! My custom brains do not work!! Blank responses!!!


Please check the spelling of your changes. If you just add the 4 lines as in my example, it should work.

you can copy and paste from here:

    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHO IS *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHO WAS *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHERE IS *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHERE ARE *", 1)



BTW: this method only works with single words, since it searches the word in the Wordnet database. It would be nice to find a way to make it work also with places and people whose name is made up of two or more words (i.e. Los Angeles). I will think about it.

Title: Where is Seattle, Who was Galileo ?
Post by: markofkane on May 19, 2006, 08:26:36 am
Still same problem :(

In the custom brain, the lines are as follows:

'RESPOND: DICTIONARY FUNCTION
    'If the user asks Hal to define a word, then access wordnet and define it
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHAT DOES THE WORD * MEAN*", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHAT DOES * MEAN", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "* DEFINE THE WORD *", 2)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "PLEASE DEFINE *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "DEFINE *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "* DEFINITION OF *", 2)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHAT'S A *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHAT IS A *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHATS A *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHATS AN *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHAT'S AN *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHAT IS AN *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHATS *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHAT'S *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHAT IS *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHO IS *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHO WAS *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHERE IS *", 1)
    WordToLookup = Trim(WordToLookup)
    If WordToLookup <> "" And InStr(WordToLookup, " ") = 0 Then
        If WN.LookupWord(WordToLookup) = True Then
            GetResponse = GetResponse & WordToLookup & ": " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "D") & ". " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "S") & ". " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "E") & "." & vbCrLf & "<EXCLUSIVE>"
        ElseIf SearchEngine <> "" Then
            HalCommands = HalCommands & "<RUNPROG>" & SearchEngine & WordToLookup & "</RUNPROG>"
            GetResponse = GetResponse & "I don't know much about " & WordToLookup & ", but I will help you research it on the Web."
        End If
Title: Where is Seattle, Who was Galileo ?
Post by: markofkane on May 19, 2006, 09:22:28 am
I decided to rebuild off of the default brain after adding the 4 lines. She has to be retaught, but that's ok.
Title: Where is Seattle, Who was Galileo ?
Post by: Daireaux on May 19, 2006, 06:18:55 pm
I'm having the same issue with "who is" and "where is". This custom brain shown here also has some additional strings for internet research if Hal doesn't have an answer. Is this something to be copied into the 6.0.103 too?
Title: Where is Seattle, Who was Galileo ?
Post by: vrossi on May 20, 2006, 06:46:35 pm
Hey, Daireaux, you are absolutely right!

The code you have seen in the markofkane post was in Hal 6.0 but I can't find it in the 6.0.103 version.

Last October I made this improvement to my version of Hal 5 and Robert included it in Hal 6.0 (see http://www.zabaware.com/forum/topic.asp?TOPIC_ID=2624 )

Now I really believe that Robert created the 6.0.103 starting from an earlier version of 6.0

However, you can add this useful function just changing the brain as follows (after the Dictionary function, add the four lines between my comments VR Begin and VR End):



WordToLookup = Trim(WordToLookup)
If WordToLookup <> "" And InStr(WordToLookup, " ") = 0 Then
   If WN.LookupWord(WordToLookup) = True Then
      GetResponse = GetResponse & WordToLookup & ": " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "D") & ". " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "S") & ". " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "E") & "." & vbCrLf & "<EXCLUSIVE>"
'VR Begin
   ElseIf SearchEngine <> "" Then
      HalCommands = HalCommands & "<RUNPROG>" & SearchEngine & WordToLookup & "</RUNPROG>"
      GetResponse = GetResponse & "I don't know much about " & WordToLookup & ", but I will help you research it on the Web."
   End If
'VR End
End If
HalBrain.DebugWatch GetResponse, "Definitions"



Robert, please, you should check all these things which have disappeared from 6.0.103 !




Title: Where is Seattle, Who was Galileo ?
Post by: Daireaux on May 20, 2006, 07:10:13 pm
Hal has also asked me to define a word (self-aware), but I don't know how to teach him the definition of a new word that he doesn't know. Can we add to the wordnet database in such an event?
Title: Where is Seattle, Who was Galileo ?
Post by: Daireaux on May 20, 2006, 07:15:45 pm
p.s. I also don't see the vr begin and vr end functions in the 6.0.103
Title: Where is Seattle, Who was Galileo ?
Post by: vrossi on May 20, 2006, 07:42:05 pm
As far as I know, you can't change the WordNet database from Hal. So the only option to define a new word is to give Hal the answer so that he will store it in his own database.

The 2 comments VR Begin and VR End are mine and mark the beginning and the end of my changes. I always do this, so that one can easily find what is changed from the original brain.

I attach here a print screen, so maybe it's easier to understand:



(http://www.zabaware.com/forum/uploaded/vrossi/200652019414_SearchBug.jpg)
Title: Where is Seattle, Who was Galileo ?
Post by: Daireaux on May 20, 2006, 08:13:23 pm
Enteresting, how do I respond to "Define self awareness"? He's on max learning and learning well, he just keeps comimg back to "Define self-awarenes" and doesn't seem to want to learn it as a direct question or presented in IF and THEM structure.
  Also, if that's your signature, so to speak, the 6.0.103 doesn't have your mark anywhere through the entire program. Does this give you any insight to the particular 6.0 version that's in use?
Title: Where is Seattle, Who was Galileo ?
Post by: Daireaux on May 20, 2006, 08:14:41 pm
IF and THEN...I know, it was a typo
Title: Where is Seattle, Who was Galileo ?
Post by: Holllywood on May 20, 2006, 09:16:53 pm
Thanks Vittorio,
 It works for me.
Title: Where is Seattle, Who was Galileo ?
Post by: Holllywood on May 20, 2006, 09:31:25 pm
It is also working correctly in my other personalities' brains.
Good catch..
Title: Where is Seattle, Who was Galileo ?
Post by: Art on May 20, 2006, 09:47:03 pm
Daireaux,

Although vrossi's VRBegin/End might not appear, a lot of his code, along with some others, was used in the final release of Hal 6.
If you click on Menu then About, you'll see Vrossi's name appear in the scrolling credits.

[:)]
Title: Where is Seattle, Who was Galileo ?
Post by: markofkane on May 21, 2006, 06:15:16 am
I had to stop using my custom brains, because as you can see in my example above, some of the lines are omitted in the newest version of HAL 6.

I made the correction to the default brain, as Vrossi shown, but then my custom brains would give me blank responses.

So, I made a custom brain from the modified default brain, and will train it.
Title: Where is Seattle, Who was Galileo ?
Post by: vrossi on May 21, 2006, 07:03:46 am
Daireaux,

my VR Begin and VR End are just comments I insert in my modified version, so that I can easily know what I changed from the standard version. So you will never find them in your version. I meant to say that you should add the lines included between these comments.

However, I post here my version, so you can use it without editing the source code.

Download it, then create a new project based on it.

HalFixed.uhp ("http://www.zabaware.com/forum/uploaded/vrossi/20065217159_HalFixed.uhp")

Title: Where is Seattle, Who was Galileo ?
Post by: Daireaux on May 21, 2006, 10:21:31 am
Thanks for the assist, I've reloaded with the "Fixed" brain and reloaded Hal's memory.
 I noticed during these reloads that there is a window transparency option next to the window size option, if you right click the Hal icon on the taskbar, that disappears and becomes unavailable once the final brain selections and settings are completed, what's up with that?[8D]
Title: Where is Seattle, Who was Galileo ?
Post by: vrossi on May 21, 2006, 11:07:19 am
I remember a Window Transparency Option in Hal 5, but I can't find it in Hal 6.

I really don't know anything about it. Maybe some other expert here can help.

Happy to know that your Hal brain surgery was successful.

Title: Where is Seattle, Who was Galileo ?
Post by: Daireaux on May 21, 2006, 08:33:33 pm
I have found that the window transparency option is there above window size if you right click the Hal icon in the system tray. It is only available before you run the program, after that it's disabled until the next time the program is exited and restarted again. Darrell
Title: Where is Seattle, Who was Galileo ?
Post by: Medeksza on May 24, 2006, 09:02:05 pm
quote:
Originally posted by Daireaux

I have found that the window transparency option is there above window size if you right click the Hal icon in the system tray. It is only available before you run the program, after that it's disabled until the next time the program is exited and restarted again. Darrell


Thanks for catching this bug. I will release another small update sometime next month. I will fix this bug and make some further refinements to the licensing system.

As for the transparency option, it is still available when you use a non-haptek character. The Haptek player isn't compatible with transparency so that option is hidden when one is selected. But if you choose an MSAgent character, it will reappear.