« NewsExtractor/SiteSpecificExtractor/yimedia_com_tw.pm
↑ Summary
NewsExtractor/SiteSpecificExtractor/turnnewsapp_com.pm »
| 1 | package NewsExtractor::SiteSpecificExtractor::ETtoday; | ||||||||||
| 2 | 1 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | extends 'NewsExtractor::GenericExtractor'; | |||||||||
| 5 | |||||||||||
| 6 | 0 | ▶ | sub journalist { | ||||||||
|
Subroutine
journalist: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 7 | 0 | my ($self) = @_; | |||||||||
| 8 | 0 | my $text = $self->content_text; | |||||||||
| 9 | 0 | my @patterns = ( | |||||||||
| 10 | qr{(?:\n|\A)(?:實習)? 記者 ([\p{Letter}、]+?) / (?:[\p{Letter}—]+)? (?:報導|編譯) \n}x, | ||||||||||
| 11 | qr{(?:\n|\A)網搜小組/([\p{Letter}、]+)報導\n}, | ||||||||||
| 12 | qr{\b((?:圖、)?文/[\p{Letter}\p{Digit}]+)\n}, | ||||||||||
| 13 | ); | ||||||||||
| 14 | |||||||||||
| 15 | 0 | my $name; | |||||||||
| 16 | 0 | for my $pat (@patterns) { | |||||||||
| 17 | 0 | ($name) = $text =~ $pat; | |||||||||
| 18 | 0 | ▶ | last if $name; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | } | ||||||||||
| 20 | 0 | return $name; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 1 | 1; | |||||||||