Thanks for the reply, it's a dynamic server side script that currently using CGI, but I am going for mod_perl. The interface is something like Google, so everytime the user make a request to lookup let's say the meaning of a word, the WordNet object have to be initialized. Is there a work around of this with mod_perl ? Thanks
----- Original Message ---- From: Rob Dixon <[EMAIL PROTECTED]> To: beginner perl mailling list <beginners@perl.org> Cc: anthony brooke <[EMAIL PROTECTED]> Sent: Saturday, May 17, 2008 0:47:52 Subject: Re: Initialize object permanently anthony brooke wrote: > > Hello, I am using Wordnet::QueryData which allow access to a very huge > dictionary data. The initialization of object > my $wn = WordNet::QueryData->new; > > took > 2 wallclock secs ( 2.36 usr + 0.07 sys = 2.43 CPU) > > Then the subsequent request for the data is exetremely fast > > For the lines below took > 0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU) > > print "Synset: ", join(", ", $wn->querySense("cat#n#7", "syns")), "\n"; > print "Hyponyms: ", join(", ", $wn->querySense("cat#n#1", "hypo")), "\n"; > print "Parts of Speech: ", join(", ", $wn->querySense("run")), "\n"; > print "Senses: ", join(", ", $wn->querySense("run#v")), "\n"; > print "Forms: ", join(", ", $wn->validForms("lay down#v")), "\n"; > print "Noun count: ", scalar($wn->listAllWords("noun")), "\n"; > print "Antonyms: ", join(", ", $wn->queryWord("dark#n#1", "ants")), "\n"; > > I > am developing a web application, is there a way to make the > initialization of object permanently in memory ? I tried to use the > Storable module. But that only give me a little increase in > performance. Anybody's idea is very much appreciated, Thank you. When you say 'web application', do you mean a server-side CGI script or a client-side program that interrogates the Web and also needs access to the dictionary? Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ Send instant messages to your online friends http://uk.messenger.yahoo.com