mircscripting.info Forum Index mircscripting.info
#mIRCscripting Forum
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

October Challenge: 2008

Post new topic   Reply to topic    mircscripting.info Forum Index -> Challenges
View previous topic :: View next topic  
Author Message
Quite Active

Joined: 31 Jan 2008
Posts: 29

PostPosted: Wed Oct 08, 2008 7:35 am    Post subject: October Challenge: 2008 Reply with quote

The October Challenge:

Hello, Ladies and Gentlemen and welcome to another one of our challenges.
This time we have for you an easy and not so complicated challenge to play with.
My idea to make this challenge came from a script sanitarium made, so thanks dude for the idea.

Here is what I want.

    .Create a remote that will use a trigger command of your liking (expect .n)
    .When this command is put in the channel it will return the nick that is most related to the random text that follows

    .(To get an example type .n blah in channel and see Sani’s reply.)

    .You can add external ideas that are related with the challenge,.


    .No Sock events.
    .No Password asking,
    .Do Not Use .n as trigger for this script (since Sanitarium ownes the original)

Please read our rules before taking part.
Back to top
View user's profile Send private message

Joined: 18 Jun 2005
Posts: 89
Location: Romania

PostPosted: Wed Oct 08, 2008 8:27 am    Post subject: Reply with quote

This challenge seems to provide no details about what should your command match and what should it not match.
For whoever is attempting to finish this task, I recommend reading the following to get a clue about approximate string matching: http://en.wikipedia.org/wiki/Fuzzy_string_searching.
On that page, there is also a link to the Levenshtein and Damerau-Levenshtein distance articles, which are pretty much all you need for this.
You can improve the Levenshtein distance algo to make it have different costs for each REPLACE() operation, depending on how close/far on the keyboard is the old char from the new char.
You may also do a soundex comparison which will tell you if the compared strings have a similar pronunciation.
Back to top
View user's profile Send private message

Joined: 25 Dec 2004
Posts: 81
Location: Marijuanaville, USA

PostPosted: Fri Oct 10, 2008 1:21 pm    Post subject: Reply with quote

To put the rules of the contest in a little more detail :

The purpose of this challenge/script, is to create code that can correct typos in just about any situation. The best way to test such a script, is to test your input against a channel nicklist to see how effective your code is, modify it, and test again, until you're happy with it.

Ideally it would be some sort of alias, given input and possible matches, and returning best match. If you use a .trigger in channel to test it out, the entire match code shouldn't be in that .trigger, but be called by alias or some other means, i.e. not locking the script to work only in nick matches in that one .trigger'd event.

This challenge is very fun to write, takes alot of trial and error, and will be very versatile when you are finished with it. I use the same matching code in scripts like the horoscope, to match when ppl typo their sign, like Sagittarius (i always misspell that), and that is only the beginning of possible uses for the code you'll create out of this challenge.

Notes on my script :

I didn't know regex (at all) when I wrote my version of this years ago, it is still regex-less today.

I did not use soundex or levenstein in my code. I knew what I needed to do, and created my own algorhythm with no external influence.

Things I used in determining matches :

First/last characters
Total # of characters
Characters in correct order/place
Total # of matching/unmatching characters
Capitalization of characters
Heavier weight/score given to NON-LETTERS

This list can go on and on and on... all up to you.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    mircscripting.info Forum Index -> Challenges All times are GMT - 5 Hours
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group