[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [kidsgames] wordnet
Hi Paul,
On Fri, 18 Feb 2000, Paul Kienzle wrote:
-->Date: Fri, 18 Feb 2000 17:14:03 +0000 (GMT)
-->From: Paul Kienzle <pkienzle@kienzle.powernet.co.uk>
-->Reply-To: kidsgames@smluc.org
-->To: kidsgames@smluc.org
-->Subject: Re: [kidsgames] wordnet
-->
-->>dict-wn...8.5 M download.... 1hour+ download, hope it's worth it....
-->>
-->>Now how do I use this thing?
-->
-->I wrote a CGI script. I sent it in to Princeton, but I see no mention
-->of it there. I'll paste it at the end of this message.
-->
Hmmm.....
-->
-->That it is in the Debian distribution already answers that question, no?
-->
I think so.
perl -w complained and the patch file is attached, but I
still didn't get it to work as the /usr/local/bin/wn is
not on my system. I discovered something that appears
to be MUCH better..... :)
The dict/dictd set of programs seem to be really awesome, and I can't
believe I didn't notice them before. dict --html <wordtodefine> gives
html output :) Check out http://www.dict.org. Perhaps the rest of you
didn't notice either. I'm not sure if we can incorporate them into our
games or not, but I like them anyway. Do a man dictd, or info dict and
see if they are on your system. I think we should, if their rfc doesn't
already cover it, an additional rfc that addes graphics, and sound...
--
Jeff Waddell
jeff@smluc.org
Kids Games Project Coordinator
main website at http://smluc.org/SIA/kidsgames/
--- wn2.pl Sun Feb 27 14:09:54 2000
+++ wn.pl Sun Feb 27 12:44:58 2000
@@ -60,7 +60,7 @@
#
print "</dl>\n\n<hr>" if $inlist;
$inlist=1;
- s/^The ([a-z]*) (.*) has ([0-9]* sense.*)$/<h2>\2 (\1)<\/h2>\n<dl>/;
+ s/^The ([a-z]*) (.*) has ([0-9]* sense.*)$/<h2>$2 ($1)<\/h2>\n<dl>/;
$POStag = $POS{$1};
print;
}
@@ -75,7 +75,7 @@
#
# First, split into idx., synonym list, gloss list
- s/^([0-9]*). (.*) -- [(](.*)[)]$/\1--\2--\3/;
+ s/^([0-9]*). (.*) -- [(](.*)[)]$/$1--\$--$3/;
($idx, $list, $gloss) = split /--/;
# Next, convert each synonym to <a href=syn>syn</a>, with spaces
@@ -94,7 +94,7 @@
$syns = $syns . reflist($');
}
$syns = "<BR>\n<strong>Syn:</strong> <cite>\n$syns\n</cite>" if $syns;
- close(<SYNS>);
+ close(SYNS);
# Collect antonyms
open(ANTS, "$WORDNET -n$idx -ants$POStag |");
@@ -107,7 +107,7 @@
print STDERR "End: $ants\n";
$ants = "<BR>\n<strong>Ant:</strong> <cite>\n$ants\n</cite>" if $ants;
print STDERR "Ant: $ants\n";
- close(<ANTS>);
+ close(ANTS);
# Finally, print it all out.
print "<dt><strong>$idx.</strong> <cite>\n$list\n</cite><dd>\n$gloss$syns$ants\n";
@@ -125,9 +125,9 @@
# ispell: & misspelling x n: alt1, ...
# html: misspelling: <a href=script?alt1>alt1</a>, ...
#
- s/^& ([-a-zA-Z_]*) .*: /<br>\1: Try , /;
- s/, ([-a-zA-Z_ ]*)/<a href="$ENV{SCRIPT_NAME}?\1">\1<\/a> /g;
- s/[?]([^"]*) /?\1+/g;
+ s/^& ([-a-zA-Z_]*) .*: /<br>$1: Try , /;
+ s/, ([-a-zA-Z_ ]*)/<a href="$ENV{SCRIPT_NAME}?$1">$1<\/a> /g;
+ s/[?]([^"]*) /?$1+/g;
print;
}
close(ALT);