| 1 | package Lingua::EN::Summarize::Filters; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | |||
| 7 | 0 | ▶ | sub easyhtml { |
|
Subroutine
easyhtml: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 8 | 0 | my $text = shift; | |
| 9 | |||
| 10 | # A very simple-minded HTML stripper. | ||
| 11 | 0 | $text =~ s/<(?:[^>\'\"]*|([\'\"]).*?\1)*>//gs; | |
| 12 | 0 | return $text; | |
| 13 | } | ||
| 14 | |||
| 15 | |||
| 16 | 1 | ▶ | sub html { |
|
Subroutine
html: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 17 | 1 | my $html = shift; | |
| 18 | 1 | my $text = ''; | |
| 19 | |||
| 20 | # closure! | ||
| 21 | 1 | ▶ | my $callback = sub { $text .= shift }; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 22 | |||
| 23 | 1 | require HTML::Parser; | |
| 24 | 1 | my $parser = HTML::Parser->new( api_version => 3, | |
| 25 | text_h => [ $callback, "dtext" ] ); | ||
| 26 | 1 | $parser->parse( $html ); | |
| 27 | 1 | $parser->eof(); | |
| 28 | |||
| 29 | 1 | return $text; | |
| 30 | } | ||
| 31 | |||
| 32 | |||
| 33 | 0 | ▶ | sub email { |
|
Subroutine
email: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 34 | 0 | my $text = shift; | |
| 35 | |||
| 36 | # magic goes here | ||
| 37 | 0 | croak "Not implemented yet FIXME FIXME FIXME"; | |
| 38 | } | ||
| 39 | |||
| 40 | |||
| 41 | |||
| 42 | 1 | 1; | |
| 43 | __END__ | ||