line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package NewsExtractor::SiteSpecificExtractor::turnnewsapp_com; |
2
|
1
|
|
|
1
|
|
10
|
use utf8; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
3
|
1
|
|
|
1
|
|
35
|
use Moo; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
4
|
|
|
|
|
|
|
extends 'NewsExtractor::GenericExtractor'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub journalist { |
7
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
8
|
0
|
|
|
|
|
|
my $text = $self->content_text; |
9
|
0
|
|
|
|
|
|
my @patterns = ( |
10
|
|
|
|
|
|
|
qr{(記者/?(\p{Letter}+))\z}, |
11
|
|
|
|
|
|
|
qr{\n((中國時報/.+))(?:\n|\z)}, |
12
|
|
|
|
|
|
|
qr{((記者/.+?))\z}, |
13
|
|
|
|
|
|
|
qr{((特派員.+?))\z}, |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
my $name; |
17
|
0
|
|
|
|
|
|
for my $pat (@patterns) { |
18
|
0
|
|
|
|
|
|
($name) = $text =~ $pat; |
19
|
0
|
0
|
|
|
|
|
last if $name; |
20
|
|
|
|
|
|
|
} |
21
|
0
|
|
|
|
|
|
return $name; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |