| 1 | package Treex::Block::W2A::EN::NormalizeForms; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 1 | $Treex::Block::W2A::EN::NormalizeForms::VERSION = '2.20151102'; | |||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use utf8; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Moose; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use Treex::Core::Common; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | extends 'Treex::Core::Block'; | |||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 0 | ▶ | sub process_anode { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
process_anode: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 0 | my ( $self, $anode ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | 0 | my $form = $anode->form; | |||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||
| 15 | 0 | ▶ | if ( $form eq '"' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | 0 | my $previous_anode = $anode->get_prev_node(); | |||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | ▶ | if ( !$previous_anode || $previous_anode->form =~ /^[\(\[{<]$/ || !$previous_anode->no_space_after ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
not $previous_anode or $previous_anode->form =~ /^[\(\[{<]$/ or not $previous_anode->no_space_after
not $previous_anode or $previous_anode->form =~ /^[\(\[{<]$/
MC/DC0%0/3
not $previous_anode or $previous_anode->form =~ /^[\(\[{<]$/ or not $previous_anode->no_space_after
not $previous_anode
$previous_anode->form =~ /^[\(\[{<]$/
not $previous_anode->no_space_after
Truth table0%0/4
not(A) or B or not(C)
A= not $previous_anodeB= $previous_anode->form =~ /^[\(\[{<]$/C= not $previous_anode->no_space_after
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 0 | $form = '``'; | |||||||||||||||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | $form =~ s/[’´]/'/g; | |||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | $form =~ s/["”»]/''/g; | |||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | $form =~ s/[“«]/``/g; | |||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | $form =~ s/—/--/g; | |||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | $anode->set_form($form); | |||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||
| 34 | __END__ | ||||||||||||||||||||||||||||||||||||||||||