Problem installing Wordnet-Similarity

858 views
Skip to first unread message

steve

unread,
Feb 24, 2010, 5:26:09 PM2/24/10
to wn-perl
I am having a problem installing Wordnet-Similarity and I was hoping
you could help me resolve it:
>>
>>
>>> I have run into a problem installing the wordnet similarity code.
>>>
>>> Wordnet Similarity 2.05 required these other programs to be installed:
>>>
>>> Wordnet 3.0
>>> Wordnet QueryData 1.49
>>> Text-Similarity 0.07
>>>
>>> Wordnet 3.0 required packages called Tcl and Tk, so I have installed
>>> Tcl/Tk 8.5.8
>>>
>>> With these other programs installed, I am able to start installing
>>> Wordnet-Similarity. I am able to compile the Makefile.PL in
>>> wordnet-similarity, but when I try to make, I get this error:
>>>
>>> "Can't locate WordNet/QueryData.pm in @INC (@INC contains: blib/arch
>>> blib/lib /etc/perl /usr/local/lib/perl/5.10.0
>>> /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5
>>> /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at
>>> utils/wnDepths.pl line 12."
>>>
>>> I am at a loss about what to do with this. If you have any idea about
>>> how to fix this, I would be very interested.
>>
>> I am using Ubuntu 9.10.

Does anyone know what problem I am having with QueryData?

Thanks,
Steve

Jason Rennie

unread,
Feb 24, 2010, 5:32:41 PM2/24/10
to wn-...@googlegroups.com
It's not installed properly.  Create WordNet/QueryData.pm under one of the @INC directories.

Cheers,

Jason


--
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+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/wn-perl?hl=en.




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

ashwin

unread,
Feb 26, 2010, 1:32:07 PM2/26/10
to wn-perl
you can try perl -I <enter path to querydata.pm here> <the rest of
your command>
(note: the "I" in "-I" is the uppercase "i", and also do not include
the "<" and ">")

hope that helps

steve

unread,
Mar 16, 2010, 6:40:24 PM3/16/10
to wn-perl
I am getting more errors like

"Loading WordNet::QueryData... Couldn't open data file: /usr/local/
WordNet-3.0/dictindex.noun at /usr/local/share/perl/5.10.0/WordNet/
QueryData.pm line 653, <GEN7> line 4636."

I have manually created a directory in /usr/local/ called Wordnet-3.0
and manually copied files there. This directory was never created
automatically. Is it looking in /usr/local because i am not
specifying the correct wordnet directory? If so, how do I do this?

Ive tried:

perl-I ../WordNet-3.0 Makefile.PL
then
test

and I get the same errors

Benjamin R. Haskell

unread,
Mar 16, 2010, 7:37:23 PM3/16/10
to wn-perl
On Tue, 16 Mar 2010, steve wrote:

> I am getting more errors like
>
> "Loading WordNet::QueryData... Couldn't open data file: /usr/local/
> WordNet-3.0/dictindex.noun at /usr/local/share/perl/5.10.0/WordNet/
> QueryData.pm line 653, <GEN7> line 4636."
>
> I have manually created a directory in /usr/local/ called Wordnet-3.0
> and manually copied files there. This directory was never created
> automatically. Is it looking in /usr/local because i am not
> specifying the correct wordnet directory? If so, how do I do this?

Yes, that's why. See: http://wordnet.princeton.edu/wordnet/faq/#environment
(they've apparently mangled my HTML, but the answer's still relevant)

You should set the environment variables WNHOME and/or WNSEARCHDIR.

This isn't the WordNet::Similarity list, BTW, but your errors seem to
stem from a mis-installed WordNet::QueryData, so maybe it's on-topic.


> Ive tried:
>
> perl-I ../WordNet-3.0 Makefile.PL
> then
> test
>
> and I get the same errors

I'm not sure what you're trying to do there...

If you want to install Perl modules in general, and you don't have root
access, you should set up CPAN to install somewhere under your home directory.

If you have root access, use CPAN normally. (sudo perl -MCPAN -eshell)

You should set up the environment variables mentioned above before
either method. Tested on Ubuntu 9.10 via VMware:


$ sudo apt-get install wordnet libdigest-sha1-perl wordnet-sense-index
(libdigest-sha1-perl: prevents problems w/CPAN?)
(wordnet-sense-index: needed for WordNet::Similarity)
(there's actually a libwordnet-querydata-perl package, too,
-- but CPAN's more up-to-date)

(lots of packages installed)

$ export WNSEARCHDIR=/usr/share/wordnet
$ sudo env WNSEARCHDIR=$WNSEARCHDIR perl -MCPAN -eshell
cpan[1]> install WordNet::QueryData

(lots of output -- answer 'yes' if needed)

cpan[2]> install WordNet::Similarity

(lots of output -- answer 'yes' if needed)
(Tests eventually failed on my machine
-- looks like rounding error
-- next step might not be necessary)

cpan[3]> notest install WordNet::Similarity

(installs without running tests)

cpan[4]> (ctrl+D to exit)

$ perl -MWordNet::QueryData -MWordNet::Similarity -le 'print "worked"'
worked
$

--
Best,
Ben

Reply all
Reply to author
Forward
0 new messages