RE: Hi, how to extract five texts on each side of an URI? I post my own perl script and its use.



Hui Wang <mailto:whui05@xxxxxxxxxxxx> wrote:

: Can anybody tell me how to improve the running speed of this
: program? Thanks.

I don't know if this is faster, but it is a more accurate
solution. Your submitted code failed under some untested
circumstances. I created another page similar to the CPAN page you
used and fed it more complicated tests.

Chakrabarti placed relevance on distance from the link. I
changed your report to reflect this relevance. Instead of
squashing all text together, it now shows a report of text token
relevance. This change allowed me to test more thoroughly as well.
Here is the sample report for one link with multiple texts inside
the anchor.

http://www.clarksonenergyhomes.com/scripts/index.html
-5: 3401 MB 280 mirrors
-4: 5501 authors 10789 modules
-3: Welcome to CPAN! Here you will find All Things Perl.
-2: Browsing
-1: Perl modules
0: Perl
0: scripts
+1: Perl binary distributions ("ports")
+2: Perl source code
+3: Perl recent arrivals
+4: recent
+5: Perl modules

You can find the modified code here (for a short time):

Script: http://www.clarksonenergyhomes.com/chakrabarti.txt
Module: http://www.clarksonenergyhomes.com/chakrabarti.pm


HTH,

Charles K. Clarkson
--
Mobile Homes Specialist
Free Market Advocate
Web Programmer

254 968-8328

http://www.clarksonenergyhomes.com/

Don't tread on my bandwidth. Trim your posts.


.



Relevant Pages

  • Re: Bug in debugger (or my code): Bizarre copy of ARRAY...
    ... >> Bizarre copy of ARRAY in leave at testtest.pl line 65. ... Do I still have a bug in my code though it ... > the latest version of perl, please report it to the Perl 5 Porters list. ...
    (comp.lang.perl.misc)
  • Re: Handling errors when working with files
    ... where you can see that first I show the normal perl errors variables, ... VMS, OS/2, and Win32. ... Most Win32-specific code will report errors via $^E. ... portable Perl code will report errors via $!. ...
    (perl.beginners)
  • DBD module loading problem
    ... Objective - execute perl modules from apache that access an oracle database ... Apache server - RHAS 4.0, ... Perl Version ...
    (perl.dbi.users)
  • Re: creating a table report
    ... > I use standard format and write command to generate the above report. ... not a question about something involving Perl. ... That is a function of your email generator/viewer, ...
    (comp.lang.perl.misc)
  • Re: Digest::MD4
    ... Perl is an acronym of Practical Extraction and Report ... Report Language. ...
    (perl.beginners)