Subject: | bad dir for WIndows |
Patched Makefile.PL to look in correct dir on Windows.
Moved tests to t/.
Attached patched distribution.
--
Alexandr Ciornii, http://chorny.net
Subject: | test.t |
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'
# $Id: test.pl,v 1.39 2006/10/17 02:37:42 jrennie Exp $
my $i = 1;
BEGIN {
$| = 1;
# print "v2.0: 1..54\nv2.1: 1..54\n";
print "1..55\n";
}
END { print "not ok 1\n" unless $loaded; }
use WordNet::QueryData;
$loaded = 1;
print "ok ", $i++, "\n";
# Insert your test code below (better if it prints "ok 13"
# (correspondingly "not ok 13") depending on the success of chunk 13
# of the test code):
print "#Loading index files. This may take a while...\n";
# Uses $WNHOME environment variable
my $wn = WordNet::QueryData->new;
#my $wn = WordNet::QueryData->new("/scratch/jrennie/WordNet-2.1/dict");
my $ver = $wn->version();
print "#Found WordNet database version $ver\n";
#print join("\n",$wn->listAllWords('n'));
($wn->querySense("sunset#n#1", "hype"))[0] eq "hour#n#2"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
scalar $wn->forms ("other sexes#1") == 3
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
scalar $wn->forms ("fussing#2") == 3
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
scalar $wn->forms ("fastest#3") == 3
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
scalar $wn->querySense ("rabbit") == 2
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
scalar $wn->querySense ("rabbit#n") == 3
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
scalar $wn->querySense ("rabbit#n#1", "hypo") == 6
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
# check that underscore is added, syntactic marker is removed
($wn->querySense("infra dig"))[0] eq "infra_dig#a"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->querySense("infra dig#a"))[0] eq "infra_dig#a#1"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->querySense("infra dig#a#1", "syns"))[0] eq "infra_dig#a#1"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->queryWord("descending"))[0] eq "descending#a"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->querySense ("lay down#v#1", "syns"))[0] eq "lay_down#v#1"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
scalar $wn->validForms ("lay down#v") == 2
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
scalar $wn->validForms ("checked#v") == 1
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
scalar $wn->querySense ("child#n#1", "syns") == 12
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
(([$wn->validForms ("lay down#2")]->[1]) eq "lie_down#2"
and ([$wn->validForms ("ghostliest#3")]->[0]) eq "ghostly#3"
and ([$wn->validForms ("farther#4")]->[1]) eq "far#4")
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->querySense("authority#n#4", "attr"))[0] eq "certain#a#2"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->validForms("running"))[1] eq "run#v"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
# test capitalization
($wn->querySense("armageddon#n#1", "syns"))[0] eq "Armageddon#n#1"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->querySense("World_War_II#n#1", "mero"))[1] eq "Battle_of_Britain#n#1"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
# test tagSenseCnt function
($wn->tagSenseCnt("academy#n") == 2)
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
# test "ies" -> "y" rule of detachment
($wn->validForms("activities#n"))[0] eq "activity#n"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
# test "men" -> "man" rule of detachment
($wn->validForms("women#n"))[0] eq "woman#n"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->queryWord("dog"))[0] eq "dog#n"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->queryWord("dog#v"))[0] eq "dog#v#1"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->queryWord("dog#n"))[0] eq "dog#n#1"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->queryWord("tall#a#1", "ants"))[0] eq "short#a#3"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->queryWord("congruity#n#1", "ants"))[0] eq "incongruity#n#1"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
scalar $wn->querySense("cat#noun#8", "syns") == 6
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
scalar $wn->querySense("car#n#1", "mero") == 29
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
scalar $wn->querySense("run#verb") == 41
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
scalar $wn->forms("axes#1") == 3
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->queryWord('shower#v#3', 'deri'))[0] eq 'shower#n#1'
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->queryWord('concentrate#v#8', 'deri'))[0] eq 'concentration#n#4'
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->querySense('curling#n#1', 'domn'))[0] eq 'Scotland#n#1'
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->querySense('sumo#n#1', 'dmnr'))[0] eq "Japan#n#2"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->querySense('bloody#r#1', 'dmnu'))[0] eq 'intensifier#n#1'
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->querySense('matrix_algebra#n#1', 'domt'))[0] eq "diagonalization#n#1"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->querySense('idiom#n#2', 'dmtu'))[0] eq 'euphonious#a#2'
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->querySense('manchuria#n#1', 'dmtr'))[0] eq 'Chino-Japanese_War#n#1'
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->validForms('involucra'))[0] eq 'involucre#n'
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
$wn->lexname('manchuria#n#1') eq 'noun.location'
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
$wn->lexname('idiom#n#2') eq 'noun.communication'
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->validForms("go-karts"))[0] eq "go-kart#n"
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
# frequency() tests
$wn->frequency('thirteenth#a#1') == 1
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
$wn->frequency('night#n#2') == 217
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
$wn->frequency('cnn#n#1') == 0
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
$wn->offset("notaword#n#1");
my @foo = $wn->getResetError();
$foo[1] == 2
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
if ($ver eq "2.0")
{
($wn->queryWord('person#n#1', 'deri'))[0] eq 'personify#v#3'
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->querySense('acropetal#a#1', 'dmnc'))[0] eq 'botany#n#1'
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
#print scalar $wn->offset("0#n#1"), "\n";
scalar $wn->offset("0#n#1") == 12967124
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
scalar $wn->listAllWords("noun") == 114648
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
#print $wn->offset("child#n#1"), "\n";
$wn->offset("child#n#1") == 9284669
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
my ($foo) = $wn->querySense ("cat#n#1", "glos");
($foo eq "feline mammal usually having thick soft fur and being unable to roar; domestic cats; wildcats ") ? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
} elsif ($ver eq "2.1")
{
($wn->queryWord('person#n#1', 'deri'))[0] eq 'personhood#n#1'
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
($wn->querySense('acropetal#a#1', 'dmnc'))[0] eq 'botany#n#2'
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
scalar $wn->offset("0#n#1") == 13561555
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
scalar $wn->listAllWords("noun") == 117097
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
$wn->offset("child#n#1") == 9771320
? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
my ($foo) = $wn->querySense ("cat#n#1", "glos");
($foo eq "feline mammal usually having thick soft fur and no ability to roar: domestic cats; wildcats ") ? print "ok ", $i++, "\n" : print "not ok ", $i++, "\n";
}
Subject: | Makefile.PL.patch |
--- Makefile.PL.dist Wed Oct 8 22:19:51 2003
+++ Makefile.PL Tue Feb 27 18:53:56 2007
@@ -5,10 +5,12 @@
# $wnHomePC). These need to be synchronized. I need to import those
# variables from QueryData.pm.
-die "*** Please set the WNHOME environment variable to the location of your\n*** WordNet installation. QueryData.pm will not work otherwise.\n*** Alternatively, you can make the installation in the default\n*** location, C:\\Program Files\\WordNet\\2.0 on Windows, or /usr/local/WordNet-2.0 on unix.\n" unless exists $ENV{WNHOME} or -d "C:\\Program Files\\WordNet\\2.0" or -d "/usr/local/WordNet-2.0";
+die "*** Please set the WNHOME environment variable to the location of your\n*** WordNet installation. QueryData.pm will not work otherwise.\n*** Alternatively, you can make the installation in the default\n*** location, C:\\Program Files\\WordNet\\2.0 on Windows, or /usr/local/WordNet-2.0 on unix.\n" unless exists $ENV{WNHOME} or -d "C:\\Program Files\\WordNet\\2.1" or -d "/usr/local/WordNet-2.1";
WriteMakefile(
'dist' => { 'COMPRESS' => 'gzip', 'SUFFIX' => '.gz', },
'NAME' => 'WordNet::QueryData',
'VERSION_FROM' => 'QueryData.pm',
+ ($ExtUtils::MakeMaker::VERSION ge '6.30_00'?
+ ('LICENSE' => 'perl', ) : ()),
);
Subject: | WordNet-QueryData-1.45.tar.gz |
Message body not shown because it is not plain text.
Subject: | Makefile.PL |
use ExtUtils::MakeMaker;
# It is bad that the default WordNet directories are in two places,
# here and at the beginning of QueryData.pm ($wnHomeUnix and
# $wnHomePC). These need to be synchronized. I need to import those
# variables from QueryData.pm.
die "*** Please set the WNHOME environment variable to the location of your\n*** WordNet installation. QueryData.pm will not work otherwise.\n*** Alternatively, you can make the installation in the default\n*** location, C:\\Program Files\\WordNet\\2.0 on Windows, or /usr/local/WordNet-2.0 on unix.\n" unless exists $ENV{WNHOME} or -d "C:\\Program Files\\WordNet\\2.1" or -d "/usr/local/WordNet-2.1";
WriteMakefile(
'dist' => { 'COMPRESS' => 'gzip', 'SUFFIX' => '.gz', },
'NAME' => 'WordNet::QueryData',
'VERSION_FROM' => 'QueryData.pm',
($ExtUtils::MakeMaker::VERSION ge '6.30_00'?
('LICENSE' => 'perl', ) : ()),
);