line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
use utf8; |
2
|
1
|
|
|
1
|
|
6
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
3
|
1
|
|
|
1
|
|
27
|
extends 'NewsExtractor::GenericExtractor'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
4
|
|
|
|
|
|
|
use Importer 'NewsExtractor::TextUtil' => qw( normalize_whitespace ); |
5
|
1
|
|
|
1
|
|
273
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
6
|
|
|
|
|
|
|
my ($self) = @_; |
7
|
|
|
|
|
|
|
my $el = $self->dom->at("div[itemprop=articleBody]"); |
8
|
0
|
|
|
0
|
0
|
|
$el->find("div.print_link, div.single_ad")->map("remove"); |
9
|
0
|
|
|
|
|
|
my $last_child = $el->children->last; |
10
|
0
|
|
|
|
|
|
if ($last_child->all_text =~ /相關鏈接:/) { |
11
|
0
|
|
|
|
|
|
$last_child->remove; |
12
|
0
|
0
|
|
|
|
|
} |
13
|
0
|
|
|
|
|
|
my $txt = $el->all_text; |
14
|
|
|
|
|
|
|
$txt = normalize_whitespace($txt); |
15
|
0
|
|
|
|
|
|
return $txt; |
16
|
0
|
|
|
|
|
|
} |
17
|
0
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my ($self) = @_; |
19
|
|
|
|
|
|
|
my ($name) = $self->content_text =~ m{ |
20
|
|
|
|
|
|
|
\n |
21
|
0
|
|
|
0
|
0
|
|
( |
22
|
0
|
|
|
|
|
|
新唐人亞太電視\p{Letter}+?報導 |
23
|
|
|
|
|
|
|
| ( 新唐人記者[\p{Letter}、]+報導 ) |
24
|
|
|
|
|
|
|
| ( 新唐人\p{Letter}+記者站綜合報導 ) |
25
|
|
|
|
|
|
|
| (\s* 記者\p{Letter}+報導/責任編輯:\p{Letter}+ \s*) |
26
|
|
|
|
|
|
|
| (\s* 責任編輯:\p{Letter}+ \s*) |
27
|
|
|
|
|
|
|
| (轉自\p{Letter}+/責任編輯:\p{Letter}+ \s*) |
28
|
|
|
|
|
|
|
| ( 採訪/\p{Letter}+ \s+ 編輯/\p{Letter}+ \s+ 後製/\p{Letter}+ ) |
29
|
|
|
|
|
|
|
) |
30
|
|
|
|
|
|
|
\z}xs; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
$name =~ s/\A(//; |
33
|
|
|
|
|
|
|
$name =~ s/)\z//; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
return $name; |
36
|
0
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
1; |