topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 19, 2024, 5:56 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: NANY 2011 Release: WordCaster  (Read 24232 times)

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
NANY 2011 Release: WordCaster
« on: January 01, 2011, 09:50 PM »
Ok... so it's a bit late, but I wanted to release something...  hope that's ok :)

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...files/WordCaster.zip
Configuration Filehttp://wraith808.com...ordCaster.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. :)
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. :)

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
WordCaster.pngNANY 2011 Release: WordCaster

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 AM by wraith808 »

kamahl

  • Supporting Member
  • Joined in 2010
  • **
  • default avatar
  • Posts: 48
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: WordCaster
« Reply #1 on: January 01, 2011, 10:01 PM »
Post-last second pledge?  :D

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.

Perry Mowbray

  • N.A.N.Y. Organizer
  • Moderator
  • Joined in 2005
  • *****
  • Posts: 1,817
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: WordCaster
« Reply #2 on: January 01, 2011, 10:12 PM »
Ok... so it's a bit late, but I wanted to release something...  hope that's ok :)

 :Thmbsup: More than OK... we don't mind late  ;)

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: WordCaster
« Reply #3 on: January 01, 2011, 10:22 PM »
Hey... it was released on January 1st :)

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.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: NANY 2011 Release: WordCaster
« Reply #4 on: January 01, 2011, 10:25 PM »
im still getting that error  from both dictionaries.

a word i tested with:  test

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: WordCaster
« Reply #5 on: January 01, 2011, 10:35 PM »
I broke the original definitions trying to fix the monkey case. :(  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.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: NANY 2011 Release: WordCaster
« Reply #6 on: January 01, 2011, 10:39 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 :)

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: WordCaster
« Reply #7 on: January 01, 2011, 10:45 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 :)) 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. :)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: NANY 2011 Release: WordCaster
« Reply #8 on: January 01, 2011, 10:51 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.

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: WordCaster
« Reply #9 on: January 01, 2011, 11:06 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.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: NANY 2011 Release: WordCaster
« Reply #10 on: January 01, 2011, 11: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.

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: WordCaster
« Reply #11 on: January 01, 2011, 11:26 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 PM by wraith808 »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: NANY 2011 Release: WordCaster
« Reply #12 on: January 01, 2011, 11:29 PM »
now try some adjectives like: sad, happy, etc.  or adverbs like: quickly.

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: WordCaster
« Reply #13 on: January 01, 2011, 11:33 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 PM by wraith808 »

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: WordCaster
« Reply #14 on: January 02, 2011, 12:08 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.

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: WordCaster
« Reply #15 on: January 02, 2011, 11:08 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).