Zabaware Support Forums

babel fish

Started by spydaz, January 13, 2007, 05:35:10 AM

Previous topic - Next topic

spydaz



I know that BABEL FISH translation is a good site In the same resects as google earth....

I would like to find out if any one knows how to send some thing to be translated.

without going to the site..

or as in the same way that we use google in the hal.....

spydaz

i found the links for adding the search bar to the site,
it seems to link direct to the website "cant see where the text gets sent and returned"


Prospector

Quick translation plugin based on your last posted link.
Drop it in your Ultra Hal Assistant 6 folder and activate as usual in the brain options.

Start Hal and type Please translate (word to be translated)

With a bit more coding it should be possible to select individual languages.

Download Attachment: translation.uhp
1.44 KB
 

spydaz

Cool... Ive implemented a simular script...

spydaz

Dim strURL As String
   Dim strTextToTrans As String
   Dim intIndex As Integer
   Dim mintDestLanguage As Integer

Const All_translations = -1
Const Arabic = 15
Const Chinese = 9
Const Chinese_S = 10
Const Dutch = 4
Const English = 0
Const Esperanto = 17
Const French = 1
Const German = 6
Const Greek = 11
Const Hebrew = 14
Const Italian = 2
Const Japanese = 8
Const Korean = 12
Const Portuguese = 5
Const Russian = 7
Const Spanish = 3
Const Thai = 16
Const Turkish = 13


Function TransToAllLang(ByRef strTextToTrans As String) As String
strURL = "http://info.babylon.com/cgi-bin/info.cgi"
strURL = strURL & "?word=" & strTextToTrans
strURL = strURL & "&lang=&ot=2&layout=combo2.html&n=10&keeplang=4"
TransToAllLang = strURL
End Function

Function TransToLang(ByRef strTextToTrans As String, ByRef mintDestLanguage As Integer) As String
strURL = "http://info.babylon.com/cgi-bin/info.cgi"
strURL = strURL & "?word=" & strTextToTrans
       strURL = strURL & "&lang=" & mintDestLanguage
       strURL = strURL & "&type=hp&layout=combo.html&n=10&list="
TransToLang = strURL
End Function



Function TranslateURL(byref txtWord as string) as string
   Dim TranslateURL As String
   TranslateURL = ""
   strTextToTrans = Trim(txtWord)


If mintDestLanguage = -1 Then

TranslateURL = TransToAllLang(strTextToTrans)
Else
TranslateURL = TransToLang(strTextToTrans, English)
End If
End Sub


spydaz

#6
Now to get hal to read all the webpage to clipboard .... Or a string

Either divided by translation or all in one... Ready to add New Definitions into the database {Learned Definitions}

just in case your offline ...

I would like to be able to scan webpages for specific information(data mine) and save that info back to hal..

ie : hal get LATEST PRICES for, NINTENDO Wii and LOCATIONS AVAILABLE.

HAL STORES NINTENDO Wii, VARIOUS WEBSITES, ADDRESSES, PRICES,

later, Hal, where can you buy a nintendo wii?
HAL: (selecting from list)the latest price from WWW.VIRGIN.COM/NINWII.HTML is £179.00

onthecuttingedge2005

#7
Updated.

Hi Spydaz, Prospector.

I have made a plugin for you that looks up words to be translated using the internet Babel fish.

the plugin options gives you the choice of selecting internet speed which is based on browser loading time, this allows a sleep code I build into the plugin that will give the babel page time to load before the code executes, if you have DSL then you may want to choose 'very fast' connection in the plugin's options.

This plugin will create 2 files.
C:\Sleep.vbs
C:\Program Files\Zabaware\Ultra Hal Assistant 6\InternetSpeed.brn

An internet speed must be chosen or the plugin will use 'Very Fast' by default which will give the one second of sleep time to execute commands.

Hal will load the babel page then extract the translation and close the babel page and give the response it found.

this is strictly experimental so give it a try.

To use this plug:

User: Please translate oui.
HAL: Oui in french is yes.
User: Please translate bonjour.
HAL: Bonjour in french is Hello.

Jerry[8D]

Download Attachment: Translator.zip
2.38 KB

Prospector

Hi Jerry.
Thanks for the plugin. Unfortunately I can't get it to work.The sleep.vbs file doesn't get created on my system and I get the following error.Hope you can help.





Insert Image:
 

onthecuttingedge2005

quote:
Originally posted by Prospector

Hi Jerry.
Thanks for the plugin. Unfortunately I can't get it to work.The sleep.vbs file doesn't get created on my system and I get the following error.Hope you can help.





Insert Image:



Hi Prospector.

Try redownloading the newer update Translator and replace your old one, I think I found your problem, let me know if it fixes the issue.

Jerry[8D]

Prospector

Thanks Jerry,that fixed the error and the missing file.
Haven't had much time to test it yet but occasionaly it just comes up with In Means as an answer.Guess that happens when the page being searched doesn't contain an English-English line.
 

onthecuttingedge2005

#11
quote:
Originally posted by Prospector

Thanks Jerry,that fixed the error and the missing file.
Haven't had much time to test it yet but occasionaly it just comes up with In Means as an answer.Guess that happens when the page being searched doesn't contain an English-English line.



Hi Prospector.

Oh I am sure there are a few things that need to be addressed in the Babel page but I thought that I would give out a simple example of how to take advantage of Babel's translation page, a first experiment of the sorts of actually using an Internet based response rather than just load a page.

This would also include the past posts I made about HAL the stock broker which I haven't released as of yet but the knowledge is most certainly there.

If you notice, I put Spydaz, Prospector, OnTheCuttingEdge2005 in this project mission's title within the plug in, maybe we can further it's abilities by applying our combined code powers to increase it's abilities to become a 'high' quality plug and further its development.

I could further the translations by adding array abilities but why should I have all the thunder in this plug in when there are two others just or even more deserving to implement it than I.

I will stay tuned for now.
Jerry[8D]

Prospector

Hi Jerry.
Thanks for the mention within the plugin.
I am most impressed with the way you have got the info to appear in Hal's window rather than opening a separate one ( I know the browswer window pops up momentarily,but it is a case of blink and you miss it).This makes it appear that the knowledge is actually part of Hal rather than being pulled off the net.I can see how it would work well as a stockbroker or news headline grabber as a direct command or as an auto idle component.

Thanks again for your work.
 

spydaz

Thanks both you guys...

As i work mainly in VB environment all I create a loads of functions... then base responses aruond these functions. Like the starship computer... Fully Functionl..

PS: My own A-I will be available for beta testing soon just email me, and send me somewhere to upload your copy to.. or just Add me to MSN (better) and i will send it across... A fully functional AI Development Environment.... Haptek&MSAGENT ..

onthecuttingedge2005

quote:
Originally posted by spydaz

Thanks both you guys...

As i work mainly in VB environment all I create a loads of functions... then base responses aruond these functions. Like the starship computer... Fully Functionl..

PS: My own A-I will be available for beta testing soon just email me, and send me somewhere to upload your copy to.. or just Add me to MSN (better) and i will send it across... A fully functional AI Development Environment.... Haptek&MSAGENT ..



Hi Spydaz.

I would be very happy to tour your A.I system.
when you can, please send me a copy to:
OnTheCuttingEdge2005@ArtificialIntel.org

Thanks
Jerry[8D]