Zabaware Support Forums

Zabaware Forums => Programming using the Ultra Hal Brain Editor => Topic started by: Buttonsvixen on February 20, 2009, 09:07:45 am

Title: spelling mod
Post by: Buttonsvixen on February 20, 2009, 09:07:45 am
Is there a spelling module for Hal? That is one thing I would find very handy above all the other features, that are not of much use to me personally.
I need something where I could go Spell "X" and Hal would return a result at least as good as googles, and in the same format:
Spell skool
Ans: yes did you mean school, a place of learning, or skull, the the structure of bone protecting an animals brain?

you get the idea. There must be someone out there who has already done this?
Google does this very well, but you have to be online to access that feature, among its most useful ^_^
Title: spelling mod
Post by: CypherGary on February 20, 2009, 09:21:35 am
I have been wishing we had a system that would check Hal's word system for the presence of each word. That word system is very complete, and the definitions are very detailed.

If a sentence contains a word that is not in the database, Hal could ask us about it, then continue.

Does had actually use the database for anything other than determining if a word is a noun, verb, ... ?
Title: spelling mod
Post by: lightspeed on February 20, 2009, 09:38:17 am
hi CypherGary , yes i too think spelling correction would be good to thats something that hal needs but also have an option where the user could put put in words ( what are you doing sounds like whatcha doing ) this although everyone doesn't do it would allow for slang words to be used which also creates a more customized voice character for more individulism . hope robert can put this on his list of future hal things !!
Title: spelling mod
Post by: James007 on February 20, 2009, 05:39:02 pm
I think if you were ambitious you could modify the "names" routine that sirts through 17,000 names in the db to work with a dictionary db that checks each word before it gets sent for processing. I don't know how to make a plugin proper but I can hack a little vbscript. -James
Title: spelling mod
Post by: Art on February 21, 2009, 09:34:36 am
Yes there is / was a spelling plug-in for Hal written by Bill DeWitt some time back. I'm not sure whether it is still available here or at his Wiki site. I might even have it in my archives somewhere. It worked quite well as I recall...sometimes too effective!

Title: spelling mod
Post by: lightspeed on February 21, 2009, 10:12:08 am
i will look through some of my old files and see if i have it i save a lot of things on back up disk sometimes if i do i will let anyone mail me and send it to them as an attachment .
Title: spelling mod
Post by: freddy888 on February 21, 2009, 10:24:44 am
Didn't that need Micro$oft Word or was it Office to work ?
Title: spelling mod
Post by: Art on February 21, 2009, 10:49:15 am
OK...Found it!

Yes, Freddy it needed or rather it used MS Word to spell check files but with a bit of tweaking I'm sure it could be modified to use the Open Office Writer (FREE) program or MS Works as it appears to be fairly simple code as follows.

With all due respect to Bill, please leave or include credit to him or his original code if modifications are made.
***********************************************
Rem Type=Plugin
Rem Name=Spell Checker
Rem Author=Bill DeWitt
Rem Host=Assistant

'This sub sets up the plug-in's option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "This should help correct your input sentence on any computer with MSWord"
    lblPlugin(0).Move 120, 120, 3300, 1200
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
End Sub

Rem PLUGIN: PRE-PROCESS
Dim Word, Doc, Uncorrected, Corrected
Const wdDialogToolsSpellingAndGrammar = 828
Const wdDoNotSaveChanges = 0
Uncorrected = InputString
Set Word = CreateObject("Word.Application")
Set Doc = Word.Documents.Add
Word.Selection.Text = Uncorrected
Word.Dialogs(wdDialogToolsSpellingAndGrammar).Show
If Len(Word.Selection.Text) <> 1 Then
   Corrected = Word.Selection.Text
Else
   Corrected = Uncorrected
End If
Doc.Close wdDoNotSaveChanges
Word.Quit
InputString = Corrected

***************************************************
Title: spelling mod
Post by: James007 on February 21, 2009, 01:20:26 pm
Thanks Art (and Bill) this is awesome!