Zabaware Support Forums
		Zabaware Forums => Programming using the Ultra Hal Brain Editor => Topic started by: onthecuttingedge2005 on November 01, 2003, 12:40:36 am
		
			
			- 
				'####### ADVANCED CORRECTIONS SCRIPTS ##############
 ' Here we can correct Hals spelling simply by telling him
 ' how to spell the incorrect word or phrase to the correct
 ' word or phrase he is suppose to say in its place.
 'Example: User: have you ever went tricker treating?
 ' Hal: I ever went tricker treating? < incorrect phrase: I ever.
 ' the bot owner will then say in these exact words:
 ' I ever is spelled have I ever.
 'Hal will then tell you he has corrected himself.
 'new corrected example:
 ' User: Have you ever went tricker treating?
 ' Hal: Have I ever went tricker treating?
 ' the method is to put only the incorrect word or phrase
 ' before the " is spelled " and the correct response directly
 ' after the " is spelled " because if you add any additional wording
 ' to you correcting statement then hal will add your verbage to the correction
 ' file so be very direct when correcting hal so he appends only the words or phrases
 ' you want corrected split by the keyword " is spelled ". the phrase " is spelled "
 ' will not be appended to the correction file, only the incorrect and correct word
 ' or phrase will be appended if you follow these instructions correctly.
 
 If InStr(OriginalSentence, " ") > 0 And InStr(1, OriginalSentence, " IS SPELLED ", 1) > 0 Then
 SentPieces = Split(OriginalSentence, " IS SPELLED ", 2, vbTextCompare)
 SubPhrase = Trim(SentPieces(0))
 PredPhrase = Trim(SentPieces(1))
 SubPhrase = HalBrain.AlphaNumericalOnly(SubPhrase)
 PredPhrase = HalBrain.AlphaNumericalOnly(PredPhrase)
 HalBrain.AppendFile WorkingDir & "corrections.brn", """" & SubPhrase & """,""" & PredPhrase & """"
 GetResponse = PredPhrase & ", <-- I have made the correction, thank you." & vbCrLf
 DebugInfo = DebugInfo & "Spelling has been corrected from: " & SubPhrase & "to" & PredPhrase & vbCrLf
 Else
 DebugInfo = DebugInfo & "Spelling has not been corrected from: " & SubPhrase & "to" & PredPhrase & vbCrLf
 End If
 
 '######## END OF ADVANCED CORRECTIONS SCRIPT #######
 
 'Best of wishes and grand new discoveries.
 ' Jerry