| 1 | package Treex::Block::Write::Sentences; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 1 | $Treex::Block::Write::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::Write::BaseTextWriter'; | |||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 1 | has '+language' => ( required => 1 ); | |||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | 1 | has '+extension' => ( default => '.txt' ); | |||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | has join_resegmented => ( | |||||||||||||||||||||||||||||||||||||||||
| 12 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||
| 13 | isa => 'Bool', | ||||||||||||||||||||||||||||||||||||||||||
| 14 | default => 1, | ||||||||||||||||||||||||||||||||||||||||||
| 15 | documentation => 'Print the sentences re-segmented' | ||||||||||||||||||||||||||||||||||||||||||
| 16 | . ' by W2A::ResegmentSentences on one line.', | ||||||||||||||||||||||||||||||||||||||||||
| 17 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | ▶ | sub process_zone { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
process_zone: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 0 | my ( $self, $zone ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | my $bundle_id = $zone->get_bundle()->id; | |||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | if ( $self->join_resegmented && $bundle_id =~ /_(\d+)of(\d+)$/ && $1 != $2 ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$self->join_resegmented and $bundle_id =~ /_(\d+)of(\d+)$/ and $1 != $2
$self->join_resegmented and $bundle_id =~ /_(\d+)of(\d+)$/
MC/DC0%0/3
$self->join_resegmented and $bundle_id =~ /_(\d+)of(\d+)$/ and $1 != $2
$self->join_resegmented
$bundle_id =~ /_(\d+)of(\d+)$/
$1 != $2
Truth table0%0/4
A and B and C
A= $self->join_resegmentedB= $bundle_id =~ /_(\d+)of(\d+)$/C= $1 != $2
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | print { $self->_file_handle } $zone->sentence, " "; | |||||||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||||||
| 25 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | print { $self->_file_handle } $zone->sentence, "\n"; | |||||||||||||||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | __END__ | ||||||||||||||||||||||||||||||||||||||||||