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