Zabaware Support Forums
Zabaware Forums => General Discussion => Topic started by: spydaz on January 13, 2007, 05:35:10 am
-
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.....
-
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"
-
http://info.babylon.com/cgi-bin/info.cgi?word=CAT&lang=&ot=2&layout=combo2.html&n=10&keeplang=1
a simular thing
-
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.
(http://icon_paperclip.gif) Download Attachment: translation.uhp (http://"http://www.zabaware.com/forum/uploaded/Prospector/200711715851_translation.uhp")
1.44 KB
-
Cool... Ive implemented a simular script...
-
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
-
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
-
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]
(http://icon_paperclip.gif) Download Attachment: Translator.zip (http://"http://www.zabaware.com/forum/uploaded/onthecuttingedge2005/2007121175942_Translator.zip")
2.38 KB
-
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: (http://www.zabaware.com/forum/uploaded/Prospector/200712114123_error.jpg)
-
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: (http://www.zabaware.com/forum/uploaded/Prospector/200712114123_error.jpg)
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]
-
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.
-
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]
-
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.
-
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 ..
-
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]
-
im just building an insaller file... tricky process ..
gathering all ther parts .dlls etc
-
I installed Babylon translator to my PC, I looked up ProgID's to create an instance of Babylon Translator from RegEdit in HKEY_CLASSES_ROOT: where ProgID's are stored.
Set BabIEPI = CreateObject("BabylonIEPI.BabylonProxy")
Set BabOffice = CreateObject("BabylonOfficeAddin.OfficeAddin")
These are the only two ProgID's that could be created from Babylon, the rest could not be created.
Here are functions from the IE tool bar: BabylonIEToolBar.dll
//BabylonTB 1.0 Type Library
//Version: 1.0
BabylonTBLib;
GUID = {162484B8-B114-453F-A344-C0B24B0F1D99};
//BabylonTB Class
CoClass BabylonTB;
GUID = {965B54B0-71E0-4611-8DE7-F73FA0B20E26};
//disp Interface
Dispatch IBabylonTB;
GUID = {499BD1D6-2D1D-4641-8DBA-A0B07C86033A};
function QueryInterface(riid: ^GUID; out ppvObj: ^^VOID); stdcall;
function AddRef: UI4; stdcall;
function Release: UI4; stdcall;
function GetTypeInfoCount(out pctinfo: ^UINT); stdcall;
function GetTypeInfo(itinfo: UINT; lcid: UI4; out pptinfo: ^^VOID); stdcall;
function GetIDsOfNames(riid: ^GUID; rgszNames: ^^I1; cNames: UINT; lcid: UI4; out rgdispid: ^I4); stdcall;
function Invoke(dispidMember: I4; riid: ^GUID; lcid: UI4; wFlags: UI2; pdispparams: ^DISPPARAMS; out pvarResult: ^Variant; out pexcepinfo: ^EXCEPINFO; out puArgErr: ^UINT); stdcall;
//method Translate
function Translate(out word: BSTR; out windowDisp: Variant); stdcall;
//BabylonTBProxy Class
CoClass BabylonProxyObj;
GUID = {1EF5CFE5-3AD3-4300-9AAC-517715BBCA39};
//TB_Utils Class
CoClass TB_Utils;
GUID = {49320284-A785-4FBE-AD4E-30CAF313573B};
//ITB_Utils Interface
Dispatch ITB_Utils;
GUID = {9EA35643-E7D6-4259-8719-5AEB3A3816A0};
function QueryInterface(riid: ^GUID; out ppvObj: ^^VOID); stdcall;
function AddRef: UI4; stdcall;
function Release: UI4; stdcall;
function GetTypeInfoCount(out pctinfo: ^UINT); stdcall;
function GetTypeInfo(itinfo: UINT; lcid: UI4; out pptinfo: ^^VOID); stdcall;
function GetIDsOfNames(riid: ^GUID; rgszNames: ^^I1; cNames: UINT; lcid: UI4; out rgdispid: ^I4); stdcall;
function Invoke(dispidMember: I4; riid: ^GUID; lcid: UI4; wFlags: UI2; pdispparams: ^DISPPARAMS; out pvarResult: ^Variant; out pexcepinfo: ^EXCEPINFO; out puArgErr: ^UINT); stdcall;
with a little programming skill one could use the created object to use as a translator in Vbscript code.
I hilighted the important function in Red.
Jerry[8D]