'Hi SkyDomain.
'I made you a script to help you with Hal's Swedish text language.
'This little script should get you going in the right direction.
'Copy and paste this script somewhere in the middle of
'your default brain.
'No additional files are needed.
'>>>>>>>>> SWEDISH FOREIGN LANGUAGE <<<<<<<<<
'Here we teach Hal translations from English to Swedish, Example: Yes in Swedish is Ja
If InStr(OriginalSentence, " ") > 0 And InStr(1, OriginalSentence, " IN SWEDISH IS ", 1) > 0 Then
SentPieces = Split(OriginalSentence, " IN SWEDISH IS ", 2, vbTextCompare)
SubPhrase = Trim(SentPieces(0))
PredPhrase = Trim(SentPieces(1))
SubPhrase = HalBrain.AlphaNumericalOnly(SubPhrase)
PredPhrase = HalBrain.AlphaNumericalOnly(PredPhrase)
'This script is used to help hal translate English to Swedish, User must teach Hal the translations.
HalBrain.AppendFile WorkingDir & "Swedish.brn", """" & SubPhrase & """,""" & PredPhrase & """"
'Here we can convert Hal's English language to Swedish by removing the apostrophy on corrections.brn line to activate.
'User will have to teach Hal the translations as mentioned above.
'HalBrain.AppendFile WorkingDir & "Corrections.brn", """" & SubPhrase & """,""" & PredPhrase & """"
GetResponse = SubPhrase & ", is, " & PredPhrase & " in Swedish."
DebugInfo = DebugInfo & "Hal is learning Swedish: " & SubPhrase & " to " & PredPhrase & VbCrLf
Else
DebugInfo = DebugInfo & "Hal is not learning Swedish: " & SubPhrase & " to " & PredPhrase & VbCrLf
End If
'Here Hal will translate English to Swedish, Example: User: Translate Yes to Swedish
'Hal: Yes, Ja in Swedish
If InStr(UserSentence, " TRANSLATE ") > 0 And InStr(1, UserSentence, " TO SWEDISH ", 1) > 0 Then
Translate = HalBrain.ChooseSentenceFromFile(WorkingDir & "Swedish.brn") & Trim(SubPhrase) & " is " & (Trim(PredPhrase))
GetResponse = Translate & VbCrLf
DebugInfo = DebugInfo & "Translating from English to Swedish: " & GetResponse & VbCrLf
Else
DebugInfo = DebugInfo & "I'm not Translating from English to Swedish: " & GetResponse & VbCrLf
End If
'Copyright 2003 2004 Gerald L.Blakley OnTheCuttingEdge2005@Yahoo.com
'All Copyrights are listed as freeware. no additional agreements
'are necessary.
'If you'd like to join us at Ultra Hal Bot Enhancement Forum
'please stop at:
http://www.geocities.com/onthecuttingedge2005/UHEF.html'Hope to see you up on the board.
'Jerry.