wdebeaum / WordNetSQL

Code to make an SQL database from WordNet 3.0 (plus the tagged gloss corpus), and a Ruby/Perl library of common functions for accessing that database.
GNU General Public License v2.0
2 stars 0 forks source link

Weird Behavior during the `make` #1

Open mrmechko opened 9 years ago

mrmechko commented 9 years ago

Trying to install this on a machine that doesn't actually have lisp installed (yet), I get the following error:

$ make
rm -f wn.db
/usr/bin/perl make-wordnet-sql-db.pl (defvar *wordnet-basepath* nil wn.db
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `/usr/bin/perl make-wordnet-sql-db.pl (defvar *wordnet-basepath* nil wn.db'
make: *** [wn.db-no-really] Error 2

now, opening up the Makefile and manually setting the path to WORDNET seems to work fine, except every now and then I get an error from the progress bar that looks like this:

Argument "      35 /usr/local/WordNet-3.0/dict/verb.Framestext\n" isn't numeric in division (/) at /Library/Perl/5.18/Term/ProgressBar.pm line 708.
Argument "      35 /usr/local/WordNet-3.0/dict/verb.Framestext\n" isn't numeric in numeric gt (>) at /Library/Perl/5.18/Term/ProgressBar.pm line 556.

Perhaps the two are not related? I'm concerned that I will discover something actually did go wrong in the time frame of 3 hours to 6 months.

wdebeaum commented 9 years ago

Yes, not having Lisp installed is probably not going to work, since WordNetSQL steals its configuration for where WordNet is from WordFinder, which is written in Lisp (though I'm not sure why the configure script cares about that...).

The second problem I think is extremely unlikely to be related. What's happening is that I'm treating the output string of wc -l as a number in order to make the progress bar for reading a file. It's supposed to work fine in Perl, even if there's leading space and junk after the number, but it seems like your Perl (or your Term::ProgressBar) is being more persnickety. Try running this command to see if you get a similar error message:

perl -e '$foo = "    35 bar"; $baz = $foo / 2; print "$baz\n";'

I get "17.5". If you do too, the problem's probably something to do with Term::ProgressBar instead of Perl. A quick fix might be to add a 0+ prefix to force the numeric interpretation, like this on line 213 of make-wordnet-sql-db.pl:

my $num_lines = 0+`wc -l $filename`;