This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Dictionary? speechles if you don' mind? :D [SOLVED]

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

The script will now redirect itself automatically if wordnetweb ever points elsewhere making having to change the config webdict variable hopefully no longer necessary.

Incith:Dictionary v1.7 ... Have a fun :P
h
holycrap
Op
Posts: 152
Joined: Mon Jan 21, 2008 11:19 pm

Post by holycrap »

# DISPLAY OPTION 8
# you get two variable to use here:
I only see one variable "%%site%%".

:D
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

holycrap wrote:
# DISPLAY OPTION 8
# you get two variable to use here:
I only see one variable "%%site%%".

:D
Yeah, was going to be two variables there. But afterwards, it was like why? They would both be the same thing. That is the display option for redirecting loop errors where the query redirects back to itself.
h
holycrap
Op
Posts: 152
Joined: Mon Jan 21, 2008 11:19 pm

Post by holycrap »

Oh... ok, I didn't know. It said two and I saw only one, just thought I might have missed something. My bad.

:D
h
holycrap
Op
Posts: 152
Joined: Mon Jan 21, 2008 11:19 pm

Post by holycrap »

Just curious why this file was created at the root directory "ig.debug.txt"?

:D
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

Standard debug code of course. :P
Remove:

Code: Select all

      # DEBUG DEBUG                    
      set junk [open "ig-debug.txt" w]
      puts $junk $html
      close $junk
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

lmao.. exactly. The purpose of that is mainly for people experienced with regexp to correct the script themselves. It contains a pure 'html' dump of the site exactly as the bot sees it before it attempts parsing, but isn't really necessary anymore so has been removed.

Also refined the matching quite a bit to use patterns more easily matched without being over greedy. This leaves the ability to use the input methods below:
!dict egg - default amount of results for each type
!dict --noun egg - default amount of noun results for egg
!dict --noun3 egg - the 3rd noun result for egg
!dict --noun1-3 egg - the 1st thru 3rd noun result for egg
!dict --all egg - every result for egg that appears for any type
!dict --all5-all egg - the 5th to last results for egg that appears for any type
!dict --nounall-3 egg - the start thru 3rd noun result for egg
!dict --noun3-all egg - the 3rd thru last noun result for egg
Where noun above can also be verb, adj, adv, or all (as well as any combination you place within the types config variable). The above also assumes the switchorder is set to 0 (type/range), and switcher is set to "--". The purpose of the typeline variable is to match the webpage as it calls them. This order must be used when configuring your types variable. You can use any number of abbreviations within types.

The script now correctly returns over-greedy matches back as user input making it much more intelligent than previous versions. Try some weird input and try to break the parser to see if you can. Note: a broken parser will eat part of your input, as the previous 'hot tub' returning results for only 'tub' was doing. Try it out and let me know what you think.
Incith:Dictionary v1.8 .. Have a fun :P
<speechles> !dict --a2-all egg
<sp33chy> <( #test )> "--a2-all egg" :: types = a; range = 2-all; input = egg; start = 2; end = 7; typeline = all
<speechles> !dict egg
<sp33chy> <( #test )> "egg" :: types = ; range = ; input = egg; start = 1; end = 1; typeline = all
<speechles> !dict --adj19-all hot tub
<sp33chy> <( #test )> "--adj19-all hot tub" :: types = adj; range = 19-all; input = hot tub; start = 19; end = 24; typeline = adjective
<speechles> !dict hot tub
<sp33chy> <( #test )> "--hot tub" :: types = ; range = hot; input = hot tub; start = 1; end = 1; typeline = all
If you have problems with editing the types and having the script recognize them correctly enabling debug will show output similar to above. The important parts are input, start, end and typeline as these parts the script is manipulating. The first two, types and range are generated by the user... ;)
h
holycrap
Op
Posts: 152
Joined: Mon Jan 21, 2008 11:19 pm

Post by holycrap »

Just another crazy request. Would it be possible to implement this to the script? Able to see in DCC what people are defining in private message with the bot? I know, incith's weather will show in DCC when people use the command in /msg bot.

Thanks.

:D
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Then of course let's get crazy. Without further adieu, welcome to insanity.
Incith:Dictionary v1.9 .. Insane isn't it? Well, it's however you configure it if you even care to use it, below is a simple example.
... in channel #testing ...
<speechles>!dict --nall blue
... in partyline/log debug ...
<(speechles@#testing)> "!dict --nall egg" --> egg (noun 1-5)
... in private message to bot ...
<speechles> !dict --v1-3 egg
... in partyline/log debug ...
<(speechles@speechles)> "!dict --v1-3 egg" --> egg (verb 1-3)
This is also fully configureable, you decide what is in your debug line yourself. At your whim are literally a ton of (well, 10.. heh) variables to use to build it. Have a fun.. :P
h
holycrap
Op
Posts: 152
Joined: Mon Jan 21, 2008 11:19 pm

Post by holycrap »

The display option is not working.

Tcl error [incith::dictionary::public_message]: can't read "state(http)": no such variable

:-(
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

holycrap wrote:The display option is not working.

Tcl error [incith::dictionary::public_message]: can't read "state(http)": no such variable

:-(
Their website appears to be down causing the issue... :(
d
digs
Voice
Posts: 12
Joined: Thu Mar 13, 2008 7:08 pm

Post by digs »

Is there anyone else that is having this

"Time-out error occured when trying to query 'http://wordnetweb.princeton.edu/perl/webwn?s=worrywart'.

It works 2 out of every 5 times. Any thoughts?
Post Reply