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!
h
holycrap
Op
Posts: 152
Joined: Mon Jan 21, 2008 11:19 pm

Post by holycrap »

This keeps getting better and better. :shock:

I have another simple request.

Since the output is like this:

<user>!dict egg
<bot> [1/3] (n) egg (animal reproductive body consisting of an ovum or embryo together with nutritive and protective envelopes; especially the thin-shelled reproductive body laid by e.g. female birds)

Instead of having the syntax <n,v,adj,adv,all><range> <word>
Why not set it to like this <range><n,v,adj,adv,all> <word>

<user>!dict 2n egg
or
<user>!dict 2-3n egg

Instead of:
<user>!dict n2 egg

Seems more logical to understand.

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 »

@holycrap:

Code: Select all

    # set this to correspond to the order you will allow switches
    # and their ranges.
    # 0 - <type><range>
    # 1 - <range><type>
    #
    # <type> being noun/verb/adverb/adjective/etc
    # <range> being <start>-<end> indexing.
    # --
    variable switchorder 1
It can now be either way, illogical or logical, you decide :)
/me includes the kitchen sink.
incith wrote:I learned to stop saying that ages ago my friend. It will never be perfect. It will always break. Someone will want something, so on and so forth.

P.S. Thank you for attaching my name to yet another script :P
Haw, lesson learned. The moment everything except the kitchen sink is included, people want the kitchen sink.. lmao ;D
Your name is attached because a good majority of the code was written by yourself. It is used in the hopes it doesn't offend you, just shows others that your scripts can be adapted to fit anything. :)

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

Post by holycrap »

Just wanna report this:

The script is not searching for a two-word meaning.

Exe:
<user> !dict hay fever
<bot> (n) fever, febrility, febricity, pyrexia, feverishness (a rise in the temperature of the body; frequently a symptom of infection)

Word like "theme park" won't work either.

but

<user> !dict all hay fever
<bot> (n) hay fever, pollinosis (a seasonal rhinitis resulting from an allergic reaction to pollen)

I think the script is omitting the first word thinking it's the 'switch or v/n..etc'

Thanks for looking into this.

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

Post by incith »

speechles wrote:It is used in the hopes it doesn't offend you, just shows others that your scripts can be adapted to fit anything. :)
Yeah, this is the intention. I will release incith:layout sooner or later to especially try and help make this true for novice coders especially. Of course, they are html-fetching inclined scripts.
holycrap wrote:Just wanna report this:
Rofl.
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:Just wanna report this:

The script is not searching for a two-word meaning.

Exe:
<user> !dict hay fever
<bot> (n) fever, febrility, febricity, pyrexia, feverishness (a rise in the temperature of the body; frequently a symptom of infection)

Word like "theme park" won't work either.

but

<user> !dict all hay fever
<bot> (n) hay fever, pollinosis (a seasonal rhinitis resulting from an allergic reaction to pollen)

I think the script is omitting the first word thinking it's the 'switch or v/n..etc'

Thanks for looking into this.

:D
Solved. The problem was when using a switch of null, there was over greedy matching going on with those regexp's. When the switch triggers, it then attempts to scan for subsets. It was assumed if the switch matched, a subset would be found within. The problem is a null switch always matches, so if a subset match isn't found the switch should be applied back onto the front of the users input. Now it does just that.

The elaborate configuration options left open to the user create this type of problem, because I don't want to break it for people wanting a switch. Yet I want the script capable enough for those not wanting a switch having the script instead use intelligence to detect when to use it and when not to. Let me know how this version works out for you..... ;)

Incith:Dictionary v1.5
h
holycrap
Op
Posts: 152
Joined: Mon Jan 21, 2008 11:19 pm

Post by holycrap »

You are super duper kewl, speechles! 8)

This piece of work is so kick ass and useful at the same time. And thanks for making everything easy to understand in the configurations.

: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 »

Well, seems I forgot one tiny detail which looks kinda neat spammed onto irc with the definitions. So here we go again, making this even better.

Code: Select all

    ## MAIN DISPLAY OPTION
    # You get five variables to use here:
    # %%type%% - The type of word defined, noun, verb, etc..
    # %%attrib%% - The lexical relation to the word, better ;)
    # %%num%% - The count of definitions for each type.
    # %%total%% - The total count of definitions for each type.
    # %%def%% - The definition.. ah ;)
    #
    # You can use these however you like, put color etc go nuts ;P
    # --
    variable display "\002%%attrib%%\002 (%%num%%/%%total%%) %%def%%"
Along with type, you now have attributes which contains the lexical information about the word. You don't need to use %%type%% if your using %%attrib%% or you can if you want to. An example is below:
<speechles> !dict --nall red
<sp33chy> Noun attribute (1/4) (n) red, redness (red color or pigment; the chromatic color resembling the hue of blood)
<sp33chy> Noun object (2/4) (n) Red, Red River (a tributary of the Mississippi River that flows eastward from Texas along the southern boundary of Oklahoma and through Louisiana)
<sp33chy> Noun person (3/4) (n) Bolshevik, Marxist, red, bolshie, bolshy (emotionally charged terms used to refer to extreme radicals or revolutionaries)
<sp33chy> Noun possession (4/4) (n) loss, red ink, red (the amount by which the cost of a business exceeds its revenue) "the company operated at a loss last year"; "the company operated in the red last year"
Incith:Dictionary v1.6
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

speechles wrote:Well, seems I forgot one tiny detail which looks kinda neat spammed onto irc with the definitions. So here we go again, making this even better.

Code: Select all

    ## MAIN DISPLAY OPTION
    # You get five variables to use here:
    # %%type%% - The type of word defined, noun, verb, etc..
    # %%attrib%% - The lexical relation to the word, better ;)
    # %%num%% - The count of definitions for each type.
    # %%total%% - The total count of definitions for each type.
    # %%def%% - The definition.. ah ;)
    #
    # You can use these however you like, put color etc go nuts ;P
    # --
    variable display "\002%%attrib%%\002 (%%num%%/%%total%%) %%def%%"
Our village demands tribute! :-P Why 2 %'s (no milk jokes) ?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

incith wrote:Our village demands tribute! :-P Why 2 %'s (no milk jokes) ?
I dunno, I've always thought double-use on start and end mainly so it wouldn't match anything else potentially. I just landed on % for the character to represent replacement for no reason. What is better to use??? This can be fixed!!!... :D
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

Oh, well, this is how I've been doing it in :weather is all, with %w0-9% and etc. I figured that's where the idea came from :P So I was just wondering why you had decided to use 2 %'s, but it's all good, just being curious. :)
a
achilles1900
Voice
Posts: 30
Joined: Mon Apr 21, 2008 5:40 am

SERVER Down

Post by achilles1900 »

Hey guys

thanks Speechless, you and Incinth are amazin'!

Loaded the script but couldnt get any results, checked the site, got this message
WordNet Service Unavailable
The WordNet service is being moved to a new server. We expect the service to be back by January 8. Please check back then.


Anyone else confirm?

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

Re: SERVER Down

Post by speechles »

Yep, I get the exact same message you have. Seems they are presently in flux while undergoing some type of migration/maintenance so they've parked the domain with some static html :(...
But.. the 8th is tomorrow so hopefully once their migration/maintenance is finished the script will again work without any modification.. *crosses fingers* :)
h
holycrap
Op
Posts: 152
Joined: Mon Jan 21, 2008 11:19 pm

Post by holycrap »

It's working now.

: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:It's working now.

:D
I found I had to change the part below to get it to work.

Code: Select all

    # set this to the website we are going to get our definitions from.
    # at the moment, only the site listed below is tested.
    # --
    set webdict "http://as200l.princeton.edu/perl/webwn\?"
Notice the new webdict url.. ;)
a
achilles1900
Voice
Posts: 30
Joined: Mon Apr 21, 2008 5:40 am

RE:

Post by achilles1900 »

Hi guys,

I can also confirm that the site is up.

You need to make the URL changes as brother speechless directs, before it works.

Again thanks speechless and incinth, you guys are Gods! really looking forward to having some fun with this!

achilles
Post Reply