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
Haw, lesson learned. The moment everything except the kitchen sink is included, people want the kitchen sink.. lmao ;Dincith 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
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.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.
Rofl.holycrap wrote:Just wanna report this:
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.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.
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%%"
Incith:Dictionary v1.6<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"
Our village demands tribute! Why 2 %'s (no milk jokes) ?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%%"
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!!!...incith wrote:Our village demands tribute! Why 2 %'s (no milk jokes) ?
I found I had to change the part below to get it to work.holycrap wrote:It's working now.
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\?"