From: Michael Granger Date: 2007-07-25T09:07:50+09:00 Subject: Re: Problems with test cases and other things with Ruby-WordNet On Jul 21, 2007, at 8:15 AM, H H wrote: > I tried to post this as a ticket to Ruby-WordNet trac as a ticket but > it kept rejecting it as "Possible Spam" so here it. (For those of you > having problems running convertdb.rb and core dumps - jump to the end) First of all, I apologize for the "Possible Spam" thing. I was getting hammered with people rewriting all my trac wiki pages with links to spam sites, so I'm trying out the new trac anti-spam plugin. Apparently it needs some tuning. And also: thanks for taking the time to not only bring this up, but in a way that's useful and can be used to improve the library for others. > After much heartache I was able to successfully install Ruby WordNet > but some of the tests fail at the end when running 'ruby test.rb'. I'm sorry you had to spend so much time getting things to run. I made the initial choice to use a BDB database to make access to the dictionaries faster, to allow on-the-fly modification of terms, and also because there wasn't a usable C interface to the WordNet dictionaries at the time. I've since wondered if it would have been less fragile, albeit much slower, to store the parsed dictionaries in PStores or something. > I am able to load up the library from Linguistics as well as > separately using require 'wordnet', but all commands bring back nil > values. The pre-packaged download does not let me run the test.rb at > all as it returns: I've removed the packaged-up source, as it's undergone quite a lot of bitrot. I'll be posting a new tarball from SVN today or tomorrow. > I checked out the latest source code from SVN using: > > svn checkout svn://deveiate.org/Ruby-WordNet/trunk > > I was able to run the tests using this revision. After successfully > converting the WordNet data files - I ran ruby test.rb and received > the following errors: > [snip] I'm not sure where those errors are coming from. Using bdb 6.0 and BerkeleyDB 4.5, I get: $ ./convertdb.rb WordNet Lexicon Converter This program will convert WordNet data files into databases used by Ruby-WordNet. This will not affect existing WordNet files, but will require up to 40Mb of disk space. Continue? [y]: >>> Warning: Existing data in the Ruby-WordNet databases will be overwritten. Continue? [n]: y Where can I find the WordNet data files? Data directory [/usr/local/WordNet-2.1/dict]: /usr/local/WordNet-3.0/ dict Converting index files... index.noun........................................................... ..committing...done (117798 entries, 0 errors). index.verb........committing...done (11529 entries, 0 errors). index.adj.............committing...done (21479 entries, 0 errors). index.adv.....committing...done (4481 entries, 0 errors). Checkpointing DB and cleaning logs...done. Converting morph files... verb.exc....committing...done (2401 entries, 0 errors). adv.exc...committing...done (7 entries, 0 errors). adj.exc...committing...done (1490 entries, 0 errors). cousin.exc...missing: skipped noun.exc....committing...done (2054 entries, 0 errors). Checkpointing DB and cleaning logs...done. Converting data files... data.adj............committing...done (18156 entries, 0 errors). data.adv....committing...done (3621 entries, 0 errors). data.verb.........committing...done (13767 entries, 0 errors). data.noun............................................committing ...done (82115 entries, 0 errors). Checkpointing DB and cleaning logs...done. done. $ ./test.rb 0 patterns given on the command line Required 3 files. Loaded suite WordNet Started ......................... Finished in 6.089183 seconds. 25 tests, 267 assertions, 0 failures, 0 errors Obviously this doesn't help with your problem, but it does seem to indicate that it's related to some difference in our environments rather than something endemic to the code. > Any information or help in getting the test and the wordnet library to > work - would be greatly appreciated. I'd be happy to help you figure out how to make it work for you, which will help me write better troubleshooting and instructions. > Perhaps a brave soul can make a gem out of it... Since it relies rather heavily on the bdb library, a gem is somewhat useless without a corresponding BDB gem on which it can depend. I suppose I could make one that just had 'bdb' in the 'requirements', but I'd think that would be misleading and prone to causing more frustration. Alternatively, it could be written differently, removing its dependency on BDB, but I'm afraid I'm not up to that task at the moment, as it's working fine for what I need it to do. I'd welcome patches, though. -- Michael Granger Rubymage, Architect, Believer The FaerieMUD Consortium ruby -e "p 12383406064495388618631689469409153107.to_s(36).tr('z',' ')"