GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  HTML::SUMMARY (3)

.ds Aq ’

NAME

HTML::Summary - generate a summary from a web page

CONTENTS

SYNOPSIS



 use HTML::Summary;
 use HTML::TreeBuilder;

 my $tree = HTML::TreeBuilder->new;
 $tree->parse( $document );

 my $summarizer = HTML::Summary->new(
     LENGTH      => 200,
     USE_META    => 1,
 );

 $summary = $summarizer->generate( $tree );
 $summarizer->option( USE_META => 1 );
 $length = $summarizer->option( LENGTH );
 if ( $summarizer->meta_used() ) {
     # do something
 }



DESCRIPTION

The HTML::Summary module produces summaries from the textual content of web pages. It does so using the location heuristic, which determines the value of a given sentence based on its position and status within the document; for example, headings, section titles and opening paragraph sentences may be favoured over other textual content. A LENGTH option can be used to restrict the length of the summary produced.

CONSTRUCTOR

new( CW$attr1 => CW$value1 [, CW$attr2 => CW$value2 ] )

Possible attributes are:
VERBOSE Generate verbose messages to STDERR.
LENGTH Maximum length of summary (in bytes). Default is 500.
USE_META Flag to tell summarizer whether to use the content of the <META> tag in the page header, if one is present, instead of generating a summary from the body text. <B>Note thatB> if the USE_META flag is set, this overrides the LENGTH flag - in other words, the summary provided by the <META> tag is returned in full, even if it is greater than LENGTH bytes. Default is 0 (no).


 my $summarizer = HTML::Summary->new(LENGTH => 200);



METHODS

    option( )

Get / set HTML::Summary configuration options.



 my $length = $summarizer->option( LENGTH );
 $summarizer->option( USE_META => 1 );



generate( CW$tree )

Takes an HTML::Element object, and generates a summary from it.



 my $tree = HTML::TreeBuilder->new;
 $tree->parse( $document );
 my $summary = $summarizer->generate( $tree );



    meta_used( )

Returns 1 if the META tag description was used to generate the summary.



 if ( $summarizer->meta_used() ) {
     # do something ...
 }



SEE ALSO

HTML::TreeBuilder, Text::Sentence, Lingua::JA::Jcode, Lingua::JA::Jtruncate.

REPOSITORY

<https://github.com/neilb/HTML-Summary>

AUTHORS

This module was originally whipped up by Neil Bowers and Tony Rose. It was then developed and maintained by Ave Wrigley and Tony Rose.

Neil Bowers is currently maintaining the HTML-Summary distribution.

Neil Bowers <neilb@cpan.org>

COPYRIGHT AND LICENSE

Copyright (c) 1997 Canon Research Centre Europe (CRE). All rights reserved.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 HTML::SUMMARY (3) 2015-10-21

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.