Block/Read/BaseCoNLLReader.pm

filter: Statementstmt 51.7% 15 / 29 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 80.0% 4 / 5 Podpod 100% 1 / 1 totaltotal 40.0% 20 / 50 CC 7 SCAR 35.8
CC
7
Cov
36%
next_document_text
56.0
BEGIN
1.0
BEGIN
1.0
CRAP 36.0
« Block/W2A/AnalysisWithAlignedTrees.pm ↑ Summary Block/W2A/ParseMSTperl.pm »
1 package Treex::Block::Read::BaseCoNLLReader;
2 2 $Treex::Block::Read::BaseCoNLLReader::VERSION = '2.20151102';
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Treex::Core::Common;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 extends 'Treex::Block::Read::BaseTextReader';
8  
9 0 ▶sub next_document_text {
Subroutine next_document_text: not called CC=7 SCAR=40.3
Pod documented
10 0 my ($self) = @_;
11 0 ▶ return $self->from->next_file_text() if $self->is_one_doc_per_file;
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_one_doc_per_file 0 0 0
12  
13 0 my $text = '';
14 0 my $empty_lines = 0;
15 LINE:
16 0 while(1){
17 0 my $line = $self->from->next_line();
18 0 ▶ if (!defined $line){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $line) 0 0 0
19 0 ▶ return if $text eq '' && !$self->from->has_next_file();
Branch: 1 branch
BranchTrueFalseTotal
if $text eq "" and not $self->from->has_next_file 0 0 0
Condition0%0/3
$text eq "" and not $self->from->has_next_file
!ll&&!rl&&r
000
MC/DC0%0/2
$text eq "" and not $self->from->has_next_file
$text eq "" not $self->from->has_next_file
Truth table0%0/3
A and not(B)
A= $text eq ""B= not $self->from->has_next_file
ABresult
0X0
100
111
20 0 last LINE;
21 }
22 0 ▶ if ( $line =~ m/^\s*$/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($line =~ /^\s*$/) 0 0 0
23 0 $empty_lines++;
24 0 ▶ return $text if $empty_lines == $self->lines_per_doc;
Branch: 1 branch
BranchTrueFalseTotal
if $empty_lines == $self->lines_per_doc 0 0 0
25 }
26 0 $text .= $line;
27 }
28 0 return $text;
29 }
30  
31  
32 2 1;
33  
34 __END__
« Block/W2A/AnalysisWithAlignedTrees.pm ↑ Summary Block/W2A/ParseMSTperl.pm »