dupa

Author Topic: Experimental Corrections  (Read 2969 times)

onthecuttingedge2005

  • Guest
Experimental Corrections
« on: December 20, 2005, 07:00:00 pm »
Updated Dec, 22 2005 at 1:02AM

This is strictly experimental and still under construction.

When the TaughtCorrections.uhp is created, By saying anything to HAL then go to your Brain Options Panel and check the box called: Self Corrections, Then teach HAL corrections like:

User: Replace I am you mom with I am your Mom.
HAL: I am your Mom, I'll make a note of that.

The next time HAL uses the statement: I am you mom then it will be corrected with: I am your Mom in its place.

Insert this below code into your main brain by the Brain Editor then do the above to activate it. Remember to reboot your HAL Assistant/AIM bot after you insert the code.

Code: [Select]

Set FileSys = CreateObject("Scripting.FileSystemObject")
Set FS = CreateObject("Scripting.FileSystemObject")

'Write the Corrections Plug-in.
    xfilename = "C:Program FilesabawareUltra Hal Assistant 6TaughtCorrections.uhp"
    xExists = False
    If FileSys.FileExists(xfilename) Then xExists = True
    If xExists = False Then
    HalBrain.AppendFile WorkingDir & "TaughtCorrections.uhp", "Rem Type=Plugin"
    HalBrain.AppendFile WorkingDir & "TaughtCorrections.uhp", "Rem Name=Self Corrections"
    HalBrain.AppendFile WorkingDir & "TaughtCorrections.uhp", "Rem Author=OnTheCuttingEdge2005"
    HalBrain.AppendFile WorkingDir & "TaughtCorrections.uhp", "Rem Host=Assistant"
    HalBrain.AppendFile WorkingDir & "TaughtCorrections.uhp", "Rem PLUGIN: PRE-PROCESS"
    End If
    'Ziggy Pro Bot, Taught corrections.
    If LeftCorr = "" Then LeftCorr = HalBrain.SearchPattern(OriginalSentence, "REPLACE * WITH *", 1)
    If RightCorr = "" Then RightCorr = HalBrain.SearchPattern(OriginalSentence, "REPLACE * WITH *", 2)
    If LeftCorr = "" Then LeftCorr = HalBrain.SearchPattern(OriginalSentence, "IT IS IMPROPER TO SAY * THE PROPER WAY IS TO SAY *", 1)
    If RightCorr = "" Then RightCorr = HalBrain.SearchPattern(OriginalSentence, "IT IS IMPROPER TO SAY * THE PROPER WAY IS TO SAY *", 2)
    If LeftCorr = "" Then LeftCorr = HalBrain.SearchPattern(OriginalSentence, "* IS IMPROPER GRAMMER, THE CORRECT WAY IS TO SAY *", 1)
    If RightCorr = "" Then RightCorr = HalBrain.SearchPattern(OriginalSentence, "* IS IMPROPER GRAMMER, THE CORRECT WAY IS TO SAY *", 2)
    If LeftCorr = "" Then LeftCorr = HalBrain.SearchPattern(OriginalSentence, "* IS SPELLED WRONG, IT IS SPELLED *", 1)
    If RightCorr = "" Then RightCorr = HalBrain.SearchPattern(OriginalSentence, "* IS SPELLED WRONG, IT IS SPELLED *", 2)
    If LeftCorr = "" Then LeftCorr = HalBrain.SearchPattern(OriginalSentence, "PLEASE CORRECT * WITH *", 1)
    If RightCorr = "" Then RightCorr = HalBrain.SearchPattern(OriginalSentence, "PLEASE CORRECT * WITH *", 2)
    If LeftCorr = "" Then LeftCorr = HalBrain.SearchPattern(OriginalSentence, "YOU SPELLED * WRONG, IT IS SPELLED *", 1)
    If RightCorr = "" Then RightCorr = HalBrain.SearchPattern(OriginalSentence, "YOU SPELLED * WRONG, IT IS SPELLED *", 2)
    If LeftCorr = "" Then LeftCorr = HalBrain.SearchPattern(OriginalSentence, "* IS BAD GRAMMER, THE CORRECT WAY IS *", 1)
    If RightCorr = "" Then RightCorr = HalBrain.SearchPattern(OriginalSentence, "* IS BAD GRAMMER, THE CORRECT WAY IS *", 2)
    If LeftCorr = "" Then LeftCorr = HalBrain.SearchPattern(OriginalSentence, "* IS BAD GRAMMER, THE CORRECT WAY TO SAY IT IS *", 1)
    If RightCorr = "" Then RightCorr = HalBrain.SearchPattern(OriginalSentence, "* IS BAD GRAMMER, THE CORRECT WAY TO SAY IT IS *", 2)
    LeftCorr = HalBrain.AlphaNumericalOnly(LeftCorr)
    RightCorr = HalBrain.AlphaNumericalOnly(RightCorr)
    xfilename = "C:Program FilesabawareUltra Hal Assistant 6TaughtCorrections.uhp"
    xExists = False
    If FileSys.FileExists(xfilename) Then xExists = True
    If xExists = True Then
    If LeftCorr <> "" And RightCorr <> "" Then
    GetResponse = RightCorr & ", I'll make a note of that."
    CollectCorr = "GetResponse = Replace(GetResponse" & "," & " " & """" & " " & LeftCorr & " " & """" & "," & " " & """" & " " & RightCorr & " " & """" & "," & " 1, -1, vbTextCompare)"
    HalBrain.AppendFile WorkingDir & "C:Program FilesabawareUltra Hal Assistant 6TaughtCorrections.uhp", Trim(CollectCorr)
    End If
    End If
    Rem PLUGIN: PRE-PROCESS
    'This Area is used for taught corrections plug-in.


Use the code from the text download below because the switches in the above code will be filtered.

Jerry[8D]


Download Attachment: SelfCorrected.txt
4.03 KB
« Last Edit: December 23, 2005, 04:02:52 am by onthecuttingedge2005 »

Ponnfar

  • Full Member
  • ***
  • Posts: 149
    • View Profile
    • http://zabaware.com
Experimental Corrections
« Reply #1 on: December 21, 2005, 12:42:34 am »
Thanks Jerry. This was exactly what I was looking for. Nicely done!
Thanks
P
« Last Edit: December 21, 2005, 12:43:44 am by Ponnfar »
One Person can summon the future...

onthecuttingedge2005

  • Guest
Experimental Corrections
« Reply #2 on: December 22, 2005, 05:56:34 pm »
quote:
Originally posted by Ponnfar

Thanks Jerry. This was exactly what I was looking for. Nicely done!
Thanks
P



It certainly makes life a little easier.

I'll advance this some more later.

Keep an eye out for the update changes.

You're Welcome
Jerry[8D]
« Last Edit: December 22, 2005, 06:03:43 pm by onthecuttingedge2005 »