File Coverage

blib/lib/NewsExtractor/SiteSpecificExtractor/turnnewsapp_com.pm
Criterion Covered Total %
statement 6 14 42.8
branch 0 2 0.0
condition n/a
subroutine 2 3 66.6
pod 0 1 0.0
total 8 20 40.0


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;