root/trunk/plagger/lib/Plagger/Plugin/Summary/TextOriginal.pm

Revision 1741 (checked in by miyagawa, 14 years ago)

merge from hackathon-summary

Line 
1 package Plagger::Plugin::Summary::TextOriginal;
2 use strict;
3 use base qw( Plagger::Plugin );
4
5 use Text::Original;
6
7 sub register {
8     my($self, $context) = @_;
9     $context->register_hook(
10         $self,
11         'summarizer.summarize' => \&summarize,
12     );
13 }
14
15 sub summarize {
16     my($self, $context, $args) = @_;
17     first_sentence($args->{text}->plaintext);
18 }
19
20 1;
21 __END__
22
23 =head1 NAME
24
25 Plagger::Plugin::Summary::TextOriginal - uses Text::Original to get first sentence
26
27 =head1 SYNOPSIS
28
29   - module: Summary::TextOriginal
30
31 =head1 DESCRIPTION
32
33 This plugin uses Text::Original CPAN module to generate summary off of
34 plaintext-ized body.
35
36 =head1 AUTHOR
37
38 Tatsuhiko Miyagawa
39
40 =head1 SEE ALSO
41
42 L<Plagger>, L<Text::Original>
43
44 =cut
Note: See TracBrowser for help on using the browser.