dupa

Author Topic: Is it ok to............  (Read 3644 times)

echoman

  • Guest
Is it ok to............
« on: November 30, 2005, 06:37:09 am »
The brain editor is ok but if I find a mis-spelt word then it can take hours to change all the entries.

In Hal 5 I used to use Agent Ransack to find little spelling mistakes many files at once. I found the program very usefull.

Is it still ok to edit files with Agent Ransack, or do you have to always go through the brain editor? If I try and edit files the AR will I upset Hals new licence system and stop Hal from working?

Oh yes, and what are the name of the files that I should edit?

Thankyou.

Echo
« Last Edit: December 01, 2005, 11:16:29 am by echoman »

Medeksza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1469
    • View Profile
    • http://www.zabaware.com
Is it ok to............
« Reply #1 on: November 30, 2005, 09:42:19 am »
quote:
Originally posted by echoman

The brain editor is ok but if I find a mis-spelt word then it can take hours to change all the entries.

In Hal 5 I used to use Agent Ransack to find little spelling mistakes many files at once. I found the program very usefull.

Is it still ok to edit files with Agent Ransack, or do you have to always go through the brain editor? If I try and edit files the AR will I upset Hals new licence system and stop Hal from working?

Oh yes, and what are the name of the files that I should edit?

Thankyou.

Echo



In Hal 6, all data is stored in 1 file, HalBrain.db. This is a SQLite database file. The only way to edit it is using either the HalBrain Editor, a command-line sqlite tool, or sqlite cc from http://bobmanc.home.comcast.net/sqlitecc.html
Robert Medeksza

echoman

  • Guest
Is it ok to............
« Reply #2 on: December 01, 2005, 07:49:23 am »
Thanks for the advice.

Is there an easy way to change spelling mustakes I have made using the brain editor. Hal6 seems to put words it has learnt in so many different places that it take forever to correct a simple spelling mistake. Will squite be able to do this.

If anyone else has some ideas then i'll be really grateful

Thankyou.....

Echo.Echo

Duskrider

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3316
  • Graphic King
    • View Profile
Is it ok to............
« Reply #3 on: December 01, 2005, 08:51:22 am »

I've not used it yet in Hal6 but you might try the corrections table.

echoman

  • Guest
Is it ok to............
« Reply #4 on: December 01, 2005, 11:02:05 am »
Yes I call up the table which has the word but there can be many tables and when I have corrected all spellings for that word that I think exist, I find that I have missed one because Hal uses my mis-spelt word again.

Then I have to go searching again......

When Hal learns he seems to put all learnt material in so many different places. This is the impression I get.

Any ideas??????

Thanks.

Echo...................

Duskrider

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3316
  • Graphic King
    • View Profile
Is it ok to............
« Reply #5 on: December 01, 2005, 11:31:54 am »

In Hal6 brain,
The 15th table under basic Responses is "Corrections" table.

onthecuttingedge2005

  • Guest
Is it ok to............
« Reply #6 on: December 01, 2005, 01:59:05 pm »

Duskrider

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3316
  • Graphic King
    • View Profile
Is it ok to............
« Reply #7 on: December 01, 2005, 03:55:21 pm »

Jerry,
Looks good, I'll give it a try too.
Thank you.  [:)]

echoman

  • Guest
Is it ok to............
« Reply #8 on: December 02, 2005, 04:28:06 am »
Jerry, this look like just what I needed! Thankyou too!

Only one problem, I am not sure where to put it. I think I understand where to put the small code at the bottom of you post, but where do I put the main bulk of the code?

Maybe I missed somthing.

Thanks.

Echo

onthecuttingedge2005

  • Guest
Is it ok to............
« Reply #9 on: December 02, 2005, 05:14:41 am »
quote:
Originally posted by echoman

Jerry, this look like just what I needed! Thankyou too!

Only one problem, I am not sure where to put it. I think I understand where to put the small code at the bottom of you post, but where do I put the main bulk of the code?

Maybe I missed somthing.

Thanks.

Echo



Just place the bulk of the code just above: 'PROCESS: REVERSE CERTAIN CONTRACTIONS AND OTHER SUBSTITUTIONS

Should be okay.

Jerry[8D]

echoman

  • Guest
Is it ok to............
« Reply #10 on: December 02, 2005, 06:47:16 am »
Hello I have followed the instructions but I cannot seem to get it to work. Below I have copied the instrustions from the posting(s) with a copy of the code actually  in place.
I cannot see what I have done wrong.
I hope someone can help. I am not into programming so I have probally done somthing obvious mistake.
Many thanks.
----------------------------------------------------------------------------------------------
Just place the bulk of the code just above: 'PROCESS: REVERSE CERTAIN CONTRACTIONS AND OTHER SUBSTITUTIONS
============
sponse = Replace(RepeatResponse, "<response>", GetResponse, 1, -1, vbTextCompare)
        DebugInfo = DebugInfo & "Hal has noticed he is repeating himself and has made a comment about it: " & GetResponse & vbCrLf
    End If

    'RESPOND: MAKE COMMENTS ABOUT SHORT PHRASES
    GetResponse = GetResponse & ShortPhrase
'Ziggy Pro Bot, Correct Spelling on the fly.
'Search for teaching on how to actually spell a word.
'Example: Pleeze is spelled Please.
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "* IS SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "* IS SPELLED *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "THE CORRECT WAY TO SPELL * IS *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "THE CORRECT WAY TO SPELL * IS *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "I MISPELLED * IT IS SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "I MISPELLED * IT IS SPELLED *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "IT IS NOT SPELLED * IT IS SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "IT IS NOT SPELLED * IT IS SPELLED *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "THE WORD * IS SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "THE WORD * IS SPELLED *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "THE WORD * IS SPELLED * CORRECTLY", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "THE WORD * IS SPELLED * CORRECTLY", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "THE WORD * IS CORRECTLY SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "THE WORD * IS CORRECTLY SPELLED *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "THE PROPER WAY TO SPELL * IS SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "THE PROPER WAY TO SPELL * IS SPELLED *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "* IS NOT A WORD, IT IS SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "* IS NOT A WORD, IT IS SPELLED *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "* IS NOT A WORD, IT IS SPELLED * TO BE CORRECT", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "* IS NOT A WORD, IT IS SPELLED * TO BE CORRECT", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "* IS NOT A WORD, IT IS SPELLED * TO BE PROPER", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "* IS NOT A WORD, IT IS SPELLED * TO BE PROPER", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "* IS PROPERLY SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "* IS PROPERLY SPELLED *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "THE CORRECT WAY FOR I TO SPELL * IS *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "THE CORRECT WAY FOR I TO SPELL * IS *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "THE CORRECT WAY FOR I TO SPELL * IS SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "THE CORRECT WAY FOR I TO SPELL * IS SPELLED *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "* IS IMPROPER SPELLING, IT IS SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "* IS IMPROPER SPELLING, IT IS SPELLED *", 2)
'If a taught spelling correction is detected then save it to getresponse corrections.
If HalBrain.CheckTableExistence("correctionsII") = False Then HalBrain.CreateTable "correctionsII", "TopicSearch", ""
If CorSpelLeft <> "" And CorSpelRight <> "" And Len(CorSpelLeft) > 0 And Len(CorSpelRight) > 0 Then
HalBrain.AddToTable "correctionsII", "TopicSearch", Trim(CorSpelLeft), Trim(CorSpelRight)
Select Case (Int(Rnd * 6) + 1)
Case 1
GetResponse = "I will have to remember that is the way to spell it." & vbCrLf
Case 2
GetResponse = "Thanks for correcting me on that word" & ". " & vbCrLf
Case 3
GetResponse = "I'll have to make a note of that." & vbCrLf
Case 4
GetResponse = "So that's the way to spell it." & vbCrLf
Case 5
GetResponse = "I did not know that, thanks." & vbCrLf
Case 6
GetResponse = "Well, I won't be misspelling that word again, thanks." & vbCrLf
End Select
End If

    'PROCESS: REVERSE CERTAIN CONTRACTIONS AND OTHER SUBSTITUTIONS
    'Standardizing on contractions can make Hal sound conversational.
    'However, certain sentence constructions don't work well
    '

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

'Add this code section below to: 'PROCESS: REVERSE CERTAIN CONTRACTIONS AND OTHER SUBSTITUTIONS 'Ziggy Pro Bot Corrections.
 GetResponse = HalBrain.ProcessSubstitutions(GetResponse, "correctionsII")
================


'PROCESS: REVERSE CERTAIN CONTRACTIONS AND OTHER SUBSTITUTIONS
    'Standardizing on contractions can make Hal sound conversational.
    'However, certain sentence constructions don't work well
    'if expressed as contractions.  For example:
    '"I don't know where it is" becomes "I don't know where it's."
    'For another example, "That's how he is" becomes "That's how he's."
    'To solve these types of cases
    'we attempt to modify certain contractions, words, and phrases
    'at the end of this function, now that Hal's thinking is done.
    GetResponse = HalBrain.HalFormat(GetResponse)
    GetResponse = HalBrain.ProcessSubstitutions(GetResponse, "corrections")
    GetResponse = HalBrain.ProcessSubstitutions(GetResponse, "correctionsII")
    'PROCESS: CALL USER BY CORRECT NAME
    'If the user has chosen a nickname or tempor

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


'And add this to: PROCESS: WORD AND PHRASE SUBSTITUTIONS
 UserSentence = HalBrain.ProcessSubstitutions(UserSentence, "correctionsII")
==================



 'Almost all of Hal's thinking is done in caps.
    UserSentence = UCase(UserSentence)

    'PROCESS: WORD AND PHRASE SUBSTITUTIONS
    'This will fix common errors in the user's sentence that the
    'HalFormat function didn't take care of. These subsitutions are
    'placed only the users sentence, not on Hal's responses. The
    'HalFormat function is used on both Hal's and the user's sentences
    'throughout the script.
    UserSentence = HalBrain.ProcessSubstitutions(UserSentence, "substitutions")
    TempParent = HalBrain.AddDebug("Debug", "Modified User Sentence")
    HalBrain.AddDebug TempParent, "Sentence: " & UserSentence
    UserSentence = HalBrain.ProcessSubstitutions(UserSentence, "correctionsII")
    'PROCESS: EMOTIONAL REACTIONS
    'We enable Hal's expressions to respond to common verbal