Flat Earth Catalogue

2016-04-23

Installing Lingua::Wordnet
Eight years later: My views on same-sex marriage, and on judicial remedies, have changed.

But anyway, I'm here to talk about the Perl module Lingua::Wordnet. I am installing this in a local::lib and a good thing too, because my sysadmin would not screw around with this stuff.

After unpacking it, you have to go into the scripts directory and run convert_db.pl in order to turn the WordNet data files into Berkeley DB files. If you intend to put your DB somewhere other than the default, which if you're not the sysadmin you do, you have to create that dir first.

Now you can make.

Next, Wordnet.pm hard-codes the location of the DB, so you'll have to change that.

Now you can make test. And fail the tests.

Next, the tests hard-code a DB offset for a synset, which is correct as of WordNet 2.0, 12 years ago, but is not correct for, say, WordNet 3.1 (in which it's 00472688%n OBVIOUSLY). So you'll want to stick a line into the early reaches of t/01.t that will look up the synset "baseball","n",1 and die printing its offset. Then you'll have to edit that into 01.t and 02.t.

Next, in 01.t, test 5, the familiarity of 'boy','n' is now 3, and 02.t seems to be crashing during test 6. Maybe.

I'm now searching through 02.t for what goes wrong by the sophisticated process of dying at various points in it. Note: Don't use Ingy's XXX function on any large objects like synsets, wordnet handles, etc. It's awfully slow to die.

Annnd, the statement producing spectacularly unhelpful error messages was $synset2 = $wn->lookup_synset('human','n',2);

Why is that? Because 'human/n' now stops at one synset. Crap on a cracker.

AHHHH! All the tests pass now! That only took 90 minutes of groveling. Now we can make test. Let's try make install and see what new horrors await.

... no new horrors. make clean for good measure. Annnd the module runs!
00:06

Powered by Blogger

 

(K) 2002-present. All rights reversed, except as noted.

Links I want to store, sometimes rants about whatever (though I'm not very diligent at posting those yet), and miscellany of my eclectic web-life. Oh, and a very basic layout.

Past
current