| 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
| |||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||
| 19 | 0 | ▶ | return if $text eq '' && !$self->from->has_next_file(); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$text eq "" and not $self->from->has_next_file
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
| |||||||||||||||||||||||||||||
| 20 | 0 | last LINE; | |||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | 0 | ▶ | if ( $line =~ m/^\s*$/ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | 0 | $empty_lines++; | |||||||||||||||||||||||||||
| 24 | 0 | ▶ | return $text if $empty_lines == $self->lines_per_doc; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | 0 | $text .= $line; | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | 0 | return $text; | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 2 | 1; | |||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | __END__ | ||||||||||||||||||||||||||||