Welcome Guest.   Make a donation to an author on the site October 23, 2014, 12:56:33 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2012! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: NANY 2011 Release: WordCaster  (Read 7901 times)
wraith808
Supporting Member
**
Posts: 6,417



"In my dreams, I always do it right."

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« on: January 01, 2011, 09:50:32 PM »

Ok... so it's a bit late, but I wanted to release something...  hope that's ok smiley

NANY 2011 Entry Information

Application NameWordCaster
Version 1.0
Short Description Utility that checks definitions on multiple sites at the same time and displays them in one interface.
Supported OSes Windows
Other Requirements .NET Framework 3.5
Web Page My Software
Download Linkhttp://www.wraith808.com/files/WordCaster.zip
Configuration Filehttp://wraith808.com/files/WordCaster.exe.config
Version History
  • 2011-01-01 - First Release
Inspiration Credited To: this coding snack request, though this isn't what the asker had in mind. smiley
Author wraith808


Description
N.A.N.Y. 2011 caught me in a bit of a rush. I didn't complete my original entry, but I had started on this because of a request that turned out to be specified incorrectly, so I finished it according to what I had originally specified it to be.

It uses a configuration file to specify several different dictionary type sites, and queries all of them on one word at the same time, showing the results. It uses regular expressions to parse the page, so is only as good as the regular expression specified in the site definitions. You can also specify different versions of the same site so that if a site might put it's definitions in more than one format, you can use the one that's appropriate (or query for more than one at once).

It's a bit rough around the edges still, and there are a couple of features that I haven't included that I want to include (for example the ability to remove spurious words that you might include to specify the definition, but that are not part of the definition). But it's currently functional, and a bit slick if I do say so myself. smiley

Features
  • Free for personal or educational use
  • Very configurable
  • Can query from multiple sites, or the same site more than once

Planned Features
  • Remove extraneous words from the returned text
  • Edit configuration from within program
  • More default configurations

Screenshots


Usage
Installation
Requires .NET 3.5 framework, but other than that, unzip and run.

Using the Application
Add sites from the drop down, though no site definition can be added more than once.  Then enter the word to be defined, and click Get Definition.

The definitions are specified in the WordCaster.exe.config file in the executable directory in the following format.
<add siteName="<Unique Site Name>" description ="<Description of Entry>" definitionRegex="<RegEx for Definition>" url="<Enter URL Here, specifying place to put word to be defined by {Term}>"/>

Uninstallation
Delete application

Known Issues
Very minimal error handling at this point.
The regular expressions are rudimentary to be kind.  They don't handle a few cases, so I'll need to tighten them up.  As I do so, the configuration file can be downloaded separately at the link above.
« Last Edit: January 02, 2011, 11:11:01 AM by wraith808 » Logged

kamahl
Supporting Member
**
Posts: 48


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #1 on: January 01, 2011, 10:01:11 PM »

Post-last second pledge?  cheesy

Also, bug report:  "Could not parse definition from HTML result using the specified RegEx Expression".  I searched "monkey", and got the error from both Dictionary.com sites.
Logged
Perry Mowbray
N.A.N.Y. Organizer
Moderator
*****
Posts: 1,807



Thoughtful Scribbles

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: January 01, 2011, 10:12:58 PM »

Ok... so it's a bit late, but I wanted to release something...  hope that's ok smiley

 Thmbsup More than OK... we don't mind late  Wink
Logged

wraith808
Supporting Member
**
Posts: 6,417



"In my dreams, I always do it right."

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: January 01, 2011, 10:22:57 PM »

Hey... it was released on January 1st smiley

Not really a bug, other than my regex skills suck.  What my regex expressions are is the html stripped down to the text, then I find something to anchor it at the beginning and end of the term.  That one seems like it should work... hmmm...

I created a new config file.  You can either download the zip again, or just get it from here.
Logged

mouser
First Author
Administrator
*****
Posts: 33,578



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: January 01, 2011, 10:25:47 PM »

im still getting that error  from both dictionaries.

a word i tested with:  test
Logged
wraith808
Supporting Member
**
Posts: 6,417



"In my dreams, I always do it right."

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: January 01, 2011, 10:35:12 PM »

I broke the original definitions trying to fix the monkey case. Sad  Download the config file and overwrite, or the zip, and the normal cases should work.  I have to figure out why it thinks that monkey doesn't match.
Logged

mouser
First Author
Administrator
*****
Posts: 33,578



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: January 01, 2011, 10:39:14 PM »

maybe the download is being cached and not grabbing the latest version when we try to download.

otherwise if its just still not working, take a deep breath, relax, and give yourself a few hours to fix it and test it with a few different words smiley
Logged
wraith808
Supporting Member
**
Posts: 6,417



"In my dreams, I always do it right."

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: January 01, 2011, 10:45:19 PM »

I just uploaded a new version of the config file and the zip.  The line you can check to make sure you have the latest in the config file has the regex expression "((noun)|(verb))1\..*?\. *?2\."  If it has a fixed number of spaces before the 2, it's not the latest config file.  It was a combination of my regex and dictionary.com not being consistent across definitions.  In all of my tests, there were 2 spaces before the second definition.  In the case of Monkey, there's only one space.  I'm sure there will be other cases that don't fit the examples I put in the config file... just let me know (or in the case of people better in regex, maybe you can correct it for me smiley) and I'll update it.  If you add dictionaries to the file, send those too so I can update the base installation if you don't mind. smiley
Logged

mouser
First Author
Administrator
*****
Posts: 33,578



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #8 on: January 01, 2011, 10:51:14 PM »

Wraith, can I ask you to give us 3 words that you can look up and return valid results for dictionaries 1 and 2.
That way we are at least testing it on the same things.  Most of the words i test give that error.
Logged
wraith808
Supporting Member
**
Posts: 6,417



"In my dreams, I always do it right."

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #9 on: January 01, 2011, 11:06:27 PM »

Some I used for the first case include: bus, test, monkey, knight, moon, stream, donation, code, program, stream, desk, table.

For the second case, I used: blog, weblog

I didn't test the second case as much, putting it in there more as an example of what it could do than anything else, so I don't have any other ones offhand.  I did it on a couple of machines other than my development machines to make sure it was nothing on my computer also, though all of them were on my local network, though I don't think that should make a difference.
Logged

mouser
First Author
Administrator
*****
Posts: 33,578



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #10 on: January 01, 2011, 11:09:09 PM »

ok so look at your test words, they are all nouns.  now try a verb like "satisfy" and you will get the error.
Logged
wraith808
Supporting Member
**
Posts: 6,417



"In my dreams, I always do it right."

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #11 on: January 01, 2011, 11:26:01 PM »

updated regex again: added create, satisfy, move, write, talk, type, shoot, tell, cast, parse, express, hardly, very, going, work to test cases.

« Last Edit: January 01, 2011, 11:40:13 PM by wraith808 » Logged

mouser
First Author
Administrator
*****
Posts: 33,578



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #12 on: January 01, 2011, 11:29:03 PM »

now try some adjectives like: sad, happy, etc.  or adverbs like: quickly.
Logged
wraith808
Supporting Member
**
Posts: 6,417



"In my dreams, I always do it right."

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #13 on: January 01, 2011, 11:33:26 PM »

some of those I tried were in those two categories... I anticipated that.  Are you having problems with some specifically?

nevermind... I just tried the ones in your e-mail.  d'oh!
« Last Edit: January 01, 2011, 11:40:23 PM by wraith808 » Logged

wraith808
Supporting Member
**
Posts: 6,417



"In my dreams, I always do it right."

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #14 on: January 02, 2011, 12:08:01 AM »

I have it updated for your cases, but now I broke some that worked... create, verb, verbally... I'm going to try to fix those before I upload a new config file.

If anyone else wants to help with my limited regex skills, the regex I'm currently down to is

(?s:((noun *?.*?1\.)|(verb *?.*?1\.)|(&mdash;adj .*1\.)|(adjective *?.*?1\.)).*? *?2\.)

Much longer now as the adj case required special handling so I had to put some common code into the capture groups.
Logged

wraith808
Supporting Member
**
Posts: 6,417



"In my dreams, I always do it right."

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #15 on: January 02, 2011, 11:08:38 AM »

Updated again, both the full package and the config file.  Now it works for all but a few cases; I think I know what the problem is, but how to fix it in the regex is a different story.  I also added freedictionary.com, which reinforced my future update to remove words added for anchoring the definition and getting more than one result (or perhaps being able to classify the lexical class that you're looking for).
Logged

Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.042s | Server load: 0.27 ]