line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
use utf8; |
2
|
1
|
|
|
1
|
|
6
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
3
|
1
|
|
|
1
|
|
26
|
extends 'NewsExtractor::GenericExtractor'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use Importer 'NewsExtractor::TextUtil' => 'normalize_whitespace'; |
6
|
1
|
|
|
1
|
|
274
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
7
|
|
|
|
|
|
|
my ($self) = @_; |
8
|
|
|
|
|
|
|
my $content_text = $self->content_text; |
9
|
0
|
|
|
0
|
0
|
|
|
10
|
0
|
|
|
|
|
|
my @patterns = ( |
11
|
|
|
|
|
|
|
qr{\b記者\s*([\p{Letter}、]+?)\s*/\s*(?:\p{Letter}+?)報導\b}, |
12
|
0
|
|
|
|
|
|
qr{\b文/([\p{Letter}、]+)\b}, |
13
|
|
|
|
|
|
|
qr{\b (?:三立準氣象 | \p{Letter}{2} 中心) / (\p{Letter}+?) 報導\b}x, |
14
|
|
|
|
|
|
|
qr{\b健康醫療網記者(\p{Letter}+?)/報導\n}x, |
15
|
|
|
|
|
|
|
qr{\b助理編輯/(\p{Letter}+?)\n}x |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $name; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
for my $pat (@patterns) { |
21
|
|
|
|
|
|
|
($name) = $content_text =~ $pat; |
22
|
0
|
|
|
|
|
|
last if defined $name; |
23
|
0
|
|
|
|
|
|
} |
24
|
0
|
0
|
|
|
|
|
|
25
|
|
|
|
|
|
|
return $name && normalize_whitespace($name); |
26
|
|
|
|
|
|
|
} |
27
|
0
|
|
0
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |