This is the new Wordnet with Images for Hal 6. I am also attaching the Perl script that makes all this possible. In essence what it does is stream images from Yahoo Image Search.
How to install:
Fire up the BrainEditor. Make sure you that Hal is not running. Find the Wordnet "Dictionary Function". Copy/Paste this script right under it. Your done! Run Hal.
Now, every time you type in "Show me a cat." it will pop up an image of a cat plus give you the definition. Also looks up images that aren't in the dictionary. "Show me Captain Kirk." A picture of Kirk appears.
You can type within these parameters:
Show me WORD. ie: Show me Einstein.
Show me a WORD. ie: Show me a dog.
Show me an WORD. ie: Show me an apple.
With a little know how you can change "Show me" to whatever you want.
You can also specify if you want the window to close automatically and for how many seconds it should be visible. Just change the "secs=" to the number you want. A value of zero (secs=0) makes the window stay up forever or until you close it manually.
Please let me know how I can improve this script or if you find any bugs. Again, the Perl script is attached in case you want to run in off your own website/server. Just don't forget to change its permissions to 755. Which means EXECUTABLE. You also need the cgi-lib.pl script which I am including. Both need to be in your cgi-bin and set to 755.
Have fun!
'RESPOND: LOOK UP IMAGE
If InStr(1, UserSentence, "SHOW YOU ", 1) > 0 Then
lookup = Replace(UserSentence, "SHOW YOU ", "", 1, -1, vbTextCompare)
If InStr(1,lookup,".", 1) > 0 Then lookup = Replace(lookup,".","",1,-1, vbTextCompare)
If InStr(1,lookup," A ", 1) > 0 Then lookup = Replace(lookup," A ","",1,-1, vbTextCompare)
If InStr(1,lookup," AN ", 1) > 0 Then lookup = Replace(lookup," AN ","",1,-1, vbTextCompare)
If WN.LookUpWord(lookup) = False Then
GetResponse = "I have no definition but I will try to find an image."
End If
If WN.LookupWord(lookup) = True Then
GetResponse = GetResponse & lookup & ": " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "D") & ". " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "S") & ". " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "E") & "." & vbCrLf & "<EXCLUSIVE>"
End If
Set IE = CreateObject("InternetExplorer.Application")
cdc = "http://www.karigirl.com/cgi-bin/popup.pl?term=" + lookup + "&secs=5" 'Secs until window closes. 0=never
IE.Navigate cdc
IE.AddressBar = False
IE.menubar = False
IE.ToolBar = False
IE.StatusBar = False
IE.width = 450
IE.height = 450
IE.resizable = False
IE.visible = True
End If
This is the Perl Script. Download only if you know what you are doing. Otherwise, just copy and paste the above text into your Brain.
Download Attachment: popup1.zip6.62Â KB