Treex/Block/Read/Sentences.pm

filter: Statementstmt 50.0% 10 / 20 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 2 / 3 Podpod 100% 1 / 1 totaltotal 39.3% 13 / 33 CC 5 SCAR 30.8
CC
5
Cov
37%
next_document
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 21.7
« Treex/Core/Loader.pm ↑ Summary Treex/Core/Phrase/BaseNTerm.pm »
1 package Treex::Block::Read::Sentences;
2 1 $Treex::Block::Read::Sentences::VERSION = '2.20210102';
3 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Treex::Core::Common;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 extends 'Treex::Block::Read::BaseTextReader';
6  
7 1 has 'skip_empty' => (is => 'ro', isa => 'Bool', default => 0);
8  
9 0 ▶sub next_document {
Subroutine next_document: not called CC=5 SCAR=34.0
Pod documented
10 0 my ($self) = @_;
11 0 my $text = $self->next_document_text();
12 0 ▶ return if !defined $text;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $text 0 0 0
13  
14 0 my $document = $self->new_document();
15 0 foreach my $sentence ( split /\n/, $text ) {
16 0 ▶ next if ($sentence =~ /^\s*$/ and $self->skip_empty);
Branch: 1 branch
BranchTrueFalseTotal
if $sentence =~ /^\s*$/ and $self->skip_empty 0 0 0
Condition0%0/3
$sentence =~ /^\s*$/ and $self->skip_empty
!ll&&!rl&&r
000
MC/DC0%0/2
$sentence =~ /^\s*$/ and $self->skip_empty
$sentence =~ /^\s*$/ $self->skip_empty
Truth table0%0/3
A and B
A= $sentence =~ /^\s*$/B= $self->skip_empty
ABresult
0X0
100
111
17 0 my $bundle = $document->create_bundle();
18 0 my $zone = $bundle->create_zone( $self->language, $self->selector );
19 0 $zone->set_sentence($sentence);
20 }
21  
22 0 return $document;
23 }
24  
25 1 1;
26  
27 __END__
« Treex/Core/Loader.pm ↑ Summary Treex/Core/Phrase/BaseNTerm.pm »