Author Topic: Corrections Tutor 01_03_2018 plugin  (Read 7989 times)

onthecuttingedge2005

  • Guest
Corrections Tutor 01_03_2018 plugin
« on: September 28, 2017, 08:41:24 pm »
Here is the up to date corrections tutor 01_03_2018 plug-in. updated 01_03_2018
'Reforged.
'do not use punctuation unless you are changing punctuation during corrections.

'for help then read this script, it tells you what you need to know.

in script here:
Code: [Select]
'Rem Type=Plugin
'Rem Name=Corrections Tutor 01_03_2018
'Rem Author=Gerald L. Blakley A.K.A OnTheCuttingEdge2005
'Rem Host=Assistant

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "THIS PLUG-IN ALLOWS A USER TO CORRECT OR REPLACE A BAD/MISSPELLED WORD/S WITH A GOOD WORD/S."
    lblPlugin(0).Move 120, 10, 3300, 1000
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
End Sub

Rem PLUGIN: POST-PROCESS
'The preceding comment is actually a plug-in directive for
'the Ultra Hal host application. It allows for code snippets
'to be inserted here on-the-fly based on user configuration.

'project: d.a.v.i.d
'01_03_2018
'all substitutions for the corrections tutor can be edited in the corrected table.
'this script can substitute bad spelling for good spelling.
'this script can also change everyday words into slang for instance people with peeps or visa versa.
'this script can be used to make custom responses.
'if the user desires.
'example:user: command replace pllays with plays
'example:user: command correct pllays with plays
'example:user: command replace cotten canndy with cotton candy
'custom replacement:user: command replace people with peeps
'hal will correct the response and store it for later conversations.

'this script does save punctuation if needed. like: help compared to help? with punctuation.
'so be careful here. it saves even the period so try not to use punctuation during corrections- easy to forget.
'unless you need it.

'this is a spell check program I designed to be user friendly.
'you can manually edit anything in the corrected table.

CleanInput = InputString
CleanInput = Trim(CleanInput)
CleanInput = UCase(LCase(CleanInput))
CleanInput = Replace(CleanInput, "  ", " ", 1, -1, vbTextCompare)
 
If CorSpelLeft  = "" Then CorSpelLeft  = HalBrain.SearchPattern(CleanInput, "*COMMAND *REPLACE * WITH *", 3)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(CleanInput, "*COMMAND *REPLACE * WITH *", 4)
If CorSpelLeft  = "" Then CorSpelLeft  = HalBrain.SearchPattern(CleanInput, "*COMMAND *CORRECT * WITH *", 3)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(CleanInput, "*COMMAND *CORRECT * WITH *", 4)

If CorSpelLeft <> "" And CorSpelRight <> "" Then
HalBrain.AddToTable "corrected", "Substitution", Lcase(CorSpelLeft), Lcase(CorSpelRight)
UltraHal = " I have corrected that error thanks. "
HalBrain.ReadOnlyMode = True
Exit Function
End If

UltraHal = HalBrain.ProcessSubstitutions(UltraHal, "corrected")
If HalBrain.CheckTableExistence("corrected") = False Then HalBrain.CreateTable "corrected", "Substitution", ""

Or by download down there.
just drop it in your HAL 6 or 7 folder.
select plug in the brain options.

Happy Holidays!
Jerry 8)
« Last Edit: January 04, 2018, 10:38:17 am by OnTheCuttingEdge »

Spitfire2600

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
Re: Corrections Tutor 2_28_17 plugin
« Reply #1 on: September 29, 2017, 01:30:52 am »
Hey Thanks for your work on this! It does what it's supposed to.

I don't suppose by any chance you've taken a look at your vrFreewill code in a while? It was an amazing plugin, windows 10 and ie 11 seems to have dampened its learning ability however.

Glad to see you active again! It's been quite a while.

-Spitfire2600
 

onthecuttingedge2005

  • Guest
Re: Corrections Tutor 2_28_17 plugin
« Reply #2 on: September 29, 2017, 01:41:56 am »
A bit of Quantum Flux never hurts anybody, have fun.

I may have to look into it further but I am swamped focusing on winning that turing test one day, for hal in its honor.
had some time to kill...

Besides, Genetic Algorithms are easy to convert to Vb script even random chances. if you know the 5 strings of simple DNA the rest is easy.

If you get the right "Combination" then the Lock will unlock.

Nature already figured it out...
« Last Edit: September 29, 2017, 02:12:04 am by OnTheCuttingEdge »

cyberjedi

  • Hero Member
  • *****
  • Posts: 810
  • The Mighty Hal Machine
    • View Profile
Re: Corrections Tutor 2_28_17 plugin
« Reply #3 on: September 29, 2017, 12:57:48 pm »
Edge: Im, working as fast as i can man....lol
I like the new chat server for Hal
you can see where i, going with all this
Hal is going to the big show again, love for my Hal to be head up with Robert's at the finish line. Hal wins either way.
See you on campus
This is some good work man, love the Script

Saw u pop in this morning....

ty

best wishes
cyberjedi
« Last Edit: September 29, 2017, 01:01:38 pm by cyberjedi »

onthecuttingedge2005

  • Guest
Re: Corrections Tutor 12_19_17 plugin
« Reply #4 on: December 19, 2017, 05:18:58 pm »
Corrections tutor has been reforged. 12_19_17

lightspeed

  • Hero Member
  • *****
  • Posts: 6761
    • View Profile
Re: Corrections Tutor 12_19_17 plugin
« Reply #5 on: December 23, 2017, 11:55:53 am »
Otce on your corrections plug in you had : 
'EXAMPLE:USER: COMMAND 'EXAMPLE:USER: COMMAND REPLACE PLLAYS WITH PLAYS PLLAYS WITH PLAYS
 does the user have to use all caps and the exact words
COMMAND REPLACE (WHATEVER WORD) WITH WHATEVER WORD) .
 AND DOES IT HAVE TO HAVE THAT PERIOD AT THE END OF THIS COMMAND SENTENCE?
I AM ASKING SPECIFICALLY BECAUSE MY LEARNING PROCESS IS NOT LIKE EVERYONE ELSE'S , I TEND TO TAKE THINKS LITERALLY.
 

onthecuttingedge2005

  • Guest
Re: Corrections Tutor 12_19_17 plugin
« Reply #6 on: December 23, 2017, 12:52:08 pm »
Otce on your corrections plug in you had : 
'EXAMPLE:USER: COMMAND 'EXAMPLE:USER: COMMAND REPLACE PLLAYS WITH PLAYS PLLAYS WITH PLAYS
 does the user have to use all caps and the exact words

Hi Lightspeed.

No, the command and replace function will replace as is. I just never lower cased the help comments.
didn't figure it would matter if it was UCase or LCase after GetResponse Processing, I'll change it to lower case
after this message so people don't get confused.

Quote
COMMAND REPLACE (WHATEVER WORD) WITH WHATEVER WORD) .

It works rather well. yep.

Quote
AND DOES IT HAVE TO HAVE THAT PERIOD AT THE END OF THIS COMMAND SENTENCE?

do not use punctuation unless you intend on changing the punctuation along with anything else you want changed. very easy to forget, if I make that
habitual mistake I can just correct it again if I need to or just manually edit it in the corrected table. it's just as easy to do.

Quote
I AM ASKING SPECIFICALLY BECAUSE MY LEARNING PROCESS IS NOT LIKE EVERYONE ELSE'S , I TEND TO TAKE THINKS LITERALLY.

I've been here serving all these good people since 2002, nothing has changed buddy.

Happy Holidays.
Jerry 8)

lightspeed

  • Hero Member
  • *****
  • Posts: 6761
    • View Profile
Re: Corrections Tutor 12_19_17 plugin
« Reply #7 on: December 23, 2017, 02:58:49 pm »
And i take it that the words command replace "words " are not in it's self learned by hal . because that would cause hal to repeat that part of a sentence on his own . example hal: command replace word

In the past i have actually seen this happen .  :P
 

onthecuttingedge2005

  • Guest
Re: Corrections Tutor 12_19_17 plugin
« Reply #8 on: December 23, 2017, 03:07:34 pm »
And i take it that the words command replace "words " are not in it's self learned by hal . because that would cause hal to repeat that part of a sentence on his own . example hal: command replace word

In the past i have actually seen this happen .  :P

Hi lightspeed.

this code
HalBrain.ReadOnlyMode = True
means that nothing else will be appended according to where it is placed in the code, in this case it is used after appending what it needs to append.
nothing else will be saved.

I hope this helps.

lightspeed

  • Hero Member
  • *****
  • Posts: 6761
    • View Profile
Re: Corrections Tutor 12_19_17 plugin
« Reply #9 on: December 23, 2017, 10:32:14 pm »
thanks  for answering , i appreciate it . :)
 

onthecuttingedge2005

  • Guest
Re: Corrections Tutor 12_19_17 plugin
« Reply #10 on: January 04, 2018, 01:52:03 am »
corrections tutor 12_19_17 plug-in. updated 01_03_2017

onthecuttingedge2005

  • Guest
Re: Corrections Tutor 01_03_2018 plugin
« Reply #11 on: January 04, 2018, 09:41:18 am »
ok had the time to change some dates in the corrections tutor. 01_03_2018

If you have a table in auto-learning table folder called "_command" then delete it. there may be unwanted commands in it.

after that it should be good. I fine tuned the appending rules so that "_command" table doesn't get appended. the "_command" table
was generated by the "auto topic script" which needs more append filtering. which is a default hal 6 and 7 script.

this seems to work very well, now changing vocabulary or punctuation is a snap. on the fly...
the corrections tutor alters strings by substitutions processing.

Jerry 8)
« Last Edit: January 04, 2018, 10:39:06 am by OnTheCuttingEdge »

lightspeed

  • Hero Member
  • *****
  • Posts: 6761
    • View Profile
Re: Corrections Tutor 01_03_2018 plugin
« Reply #12 on: January 07, 2018, 11:11:36 am »
i am trying out the updated corrections plug in , on a problem quote i have in hal . i think this plug in a a "very" good idea as it does it on the fly so a person doesn't have to manually go in and edit  bad things in hal. this should be a very useful plug in to people using hal.  :)  although this won't work on a separate issue i am having about the answer is equal " i don't think it will )  as that i think is a answer from hal that is given when hal is trying to do a search of something ? from a plug in" and when he can't perform the task" gives the default answer of " and the answer is equal "

UPDATE : WHEN i tried to replace something now it says " Command replace obama?s Hawaii birth certificate is 100 forged!"
« Last Edit: January 07, 2018, 11:16:38 am by lightspeed »
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6761
    • View Profile
Re: Corrections Tutor 01_03_2018 plugin
« Reply #13 on: January 07, 2018, 12:07:02 pm »
i am putting this in here to . the problem i had was when i would say hi or hello . it would go to something that i taught hal from a website and say " obama?s Hawaii birth certificate is 100 forged " don't ask me how or why hal associated hi with that statement . makes no sense to me in the debug it traced it to the word Hawaii which again made no sense to me when saying the word hi or hello .
no the corrections tutor is saying : 

Morning Honey. Ten o'clock is good for a break? With it has been shown and proven that obama?s Hawaii birth certificate is 100 percent forged!

i learned it to add the word percent in the updated sentence to sound right but i also see it added the word " With" . the reason is in the explanation within the plug in i saw otce use the word with ( as i said sometimes i take things literally . so this was my mistake , to be sure and not use the word with. )  i earlier showed where it repeated even the command word "see above"  i noticed this was all in caps so maybe that is what cause hal to learn the whole word command instead of using the word as a command within the plug in . maybe this can be corrected by in the commands being able to use lower and upper case letters for command ? 
i am hoping that since hal learned wrongly and is now saying the word "command and the sentence " as a learned thing that i can replace that on the fly . i have tried doing that so will have to see if it worked. which i hope it will as i forgot to back my hal brain up first.
 

onthecuttingedge2005

  • Guest
Re: Corrections Tutor 01_03_2018 plugin
« Reply #14 on: January 07, 2018, 12:37:34 pm »

UPDATE : WHEN i tried to replace something now it says " Command replace obama?s Hawaii birth certificate is 100 forged!"

the line you have there can probably be deleted in the AutoTopicLearning Tables called "_command"  <-- delete it then refresh tables.

the old corrections tutor did not see this in the correct format, because there is no "with" splitting the substitutions command within the line above.

however when it did not trigger the AutoTopic plug-in saw it as something to store. if the word With was included as a split between replacements then "_command"
would of never been generated.

I will fix that in-case it ever happens again, creating a "_command" in Auto Topic when misspelling is accidentally in the incorrect format.
There is no better tools than the forge and hammer.

Jerry 8)
« Last Edit: January 07, 2018, 01:00:01 pm by OnTheCuttingEdge »