|
wraith808
|
 |
« 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 DescriptionN.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 UsageInstallationRequires .NET 3.5 framework, but other than that, unzip and run. Using the ApplicationAdd 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}>"/> UninstallationDelete application Known IssuesVery 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
|
 |
« Reply #1 on: January 01, 2011, 10:01:11 PM » |
|
Post-last second pledge?  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
|
|
|
|
|
|
|
|
wraith808
|
 |
« Reply #3 on: January 01, 2011, 10:22:57 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.
|
|
|
|
|
Logged
|
|
|
|
|
mouser
|
 |
« 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
|
 |
« Reply #5 on: January 01, 2011, 10:35:12 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.
|
|
|
|
|
Logged
|
|
|
|
|
mouser
|
 |
« 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 
|
|
|
|
|
Logged
|
|
|
|
|
wraith808
|
 |
« 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  ) 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. 
|
|
|
|
|
Logged
|
|
|
|
|
mouser
|
 |
« 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
|
 |
« 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
|
 |
« 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
|
 |
« 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
|
 |
« Reply #12 on: January 01, 2011, 11:29:03 PM » |
|
now try some adjectives like: sad, happy, etc. or adverbs like: quickly.
|
|
|
|
|
Logged
|
|
|
|
|
wraith808
|
 |
« 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
|
 |
« 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\.)|(—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
|
 |
« 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
|
|
|
|
|