Installation problem: existing discussions do not help :(

195 views
Skip to first unread message

Ritwik Banerjee

unread,
Oct 27, 2009, 3:19:10 AM10/27/09
to wn-perl
I am working on Ubuntu Jaunty, and after trying really hard to get the
Ruby WordNet binding, I switched to Perl. But even this has decided to
not help me. Here are the details:

$ perl -v
This is perl, v5.10.0 built for x86_64-linux-gnu-thread-multi

Wordnet installed in /usr/share/wordnet, and WNHOME set correctly.

$ echo $WNHOME
/usr/share/wordnet

$ perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for WordNet::QueryData

$ make
cp QueryData.pm blib/lib/WordNet/QueryData.pm
Manifying blib/man3/WordNet::QueryData.3pm

$ make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl
ok 1
Use of uninitialized value in concatenation (.) or string at blib/lib/
WordNet/QueryData.pm line 357.
Use of uninitialized value in concatenation (.) or string at blib/lib/
WordNet/QueryData.pm line 357.
Use of uninitialized value in concatenation (.) or string at blib/lib/
WordNet/QueryData.pm line 357.
Use of uninitialized value in concatenation (.) or string at blib/lib/
WordNet/QueryData.pm line 357.
Use of uninitialized value in concatenation (.) or string at blib/lib/
WordNet/QueryData.pm line 389.
Couldn't open data file: index.noun at blib/lib/WordNet/QueryData.pm
line 653.
make: *** [test_dynamic] Error 2

I tried looking at line 653, but didn't really understand what was
happening.

Any help will be really appreciated. And, of course, sooner the
better. :)

- Ritwik

Jason Rennie

unread,
Oct 27, 2009, 7:35:51 AM10/27/09
to wn-...@googlegroups.com
On Tue, Oct 27, 2009 at 3:19 AM, Ritwik Banerjee <ritwik....@gmail.com> wrote:
Wordnet installed in /usr/share/wordnet, and WNHOME set correctly.

Actually, Ubuntu does not provide the proper directory structure (no "dict" dir) for WNHOME.  You need to set WNSEARCHDIR to /usr/share/wordnet.

Cheers,

Jason

--
Jason Rennie
Research Scientist, ITA Software
617-714-2645
http://www.itasoftware.com/

Jason Rennie

unread,
Oct 27, 2009, 7:38:56 PM10/27/09
to wn-...@googlegroups.com
I just updated the README with this suggestion and published a new release, 1.49.  Only change is to the README file.

Jason

Ritwik Banerjee

unread,
Oct 28, 2009, 6:10:51 AM10/28/09
to wn-perl
Thanks a lot! It installed perfectly once I added WNSEARCHDIR to my
bashrc. And yes, it's a good idea to include this in the README since
a lot of people use ubuntu now. I will trouble just one more time
regarding this with the following question:

I simply copied the synopsis provided in the cpan page for
WordNet::QueryData into a test.pl, but this is what I am getting:

"WordNet::QueryData=HASH(0x2520d10)" is not exported by the
WordNet::QueryData module
Can't continue after import errors at test.pl line 4
BEGIN failed--compilation aborted at test.pl line 4.

Either I am missing something extremely elementary, or something went
wrong in the installation. Any ideas?

- Ritwik

Jason Rennie

unread,
Oct 28, 2009, 9:52:04 AM10/28/09
to wn-...@googlegroups.com
Take a look at the test.pl that comes with QueryData.  It runs similar tests and more.  If you want us to help debug, you need to provide us with, at least, the code you're running, your @INC (i.e. -I options you pass to perl) and the location of QueryData.pm.

Jason

C.J. Adams-Collier

unread,
Oct 28, 2009, 11:22:52 AM10/28/09
to wn-...@googlegroups.com
BTW, this works for me. It doesn't do what I'd like, but it works ;)

#!/usr/bin/perl -w

my $splitter = new Lingua::EN::Splitter;
my $wn = WordNet::QueryData->new( noload => 1, dir => "/usr/share/wordnet/",);

my $sentence =
"The meeting minutes for the October 1st board meeting is now public.";

my $words = $splitter->words( $sentence );

my @POS;

my $max_num_pos = 0;

# Find part of speech for each word in the sentence
foreach my $word ( @$words ){
my $parts =
[ map { s/^$word#//; uc } $wn->querySense($word) ];

$max_num_pos = int(@$parts)
if($max_num_pos < int(@$parts));

push(@POS, $parts);
}


my $word_count = int(@$words);

my $format = join ('|', map{' %-8s'} (1 .. $word_count));

my $out = sprintf($format, @$words);
my $outLen = length $out;
print($out, "\n",
'-' x $outLen, "\n"
);

for( my $i = 0; $i < $max_num_pos; $i++ ){
my @row;
for( my $j = 0; $j < $word_count; $j++ ){
if( exists $POS[$j]->[$i] ){
push(@row, $POS[$j]->[$i]);
}else{
push(@row, "");
}
}
printf($format."\n", @row);
}

> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "wn-perl" group.
> To post to this group, send email to wn-...@googlegroups.com
> To unsubscribe from this group, send email to wn-perl
> +unsub...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/wn-perl?hl=en
> -~----------~----~----~----~------~----~------~--~---
>

signature.asc
Reply all
Reply to author
Forward
0 new messages