| 1 | package Lingua::EO::Supersignoj; | ||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use Attribute::Property; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use utf8; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 1 | our $VERSION = '0.02'; | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 1 | our %cxapeloj = ( | |||||||||||||||||||||||||||
| 9 | h => [ qw/ Ch ch Gh gh Hh hh Jh jh Sh sh Uw uw / ], | ||||||||||||||||||||||||||||
| 10 | H => [ qw/ CH ch GH gh HH hh JH jh SH sh UW uw / ], | ||||||||||||||||||||||||||||
| 11 | x => [ qw/ Cx cx Gx gx Hx hx Jx jx Sx sx Ux ux / ], | ||||||||||||||||||||||||||||
| 12 | X => [ qw/ CX cx GX gx HX hx JX jx SX sx UX ux / ], | ||||||||||||||||||||||||||||
| 13 | poste => [ qw/ C^ c^ G^ g^ H^ h^ J^ j^ S^ s^ U^ u^ / ], | ||||||||||||||||||||||||||||
| 14 | fronte => [ qw/ ^C ^c ^G ^g ^H ^h ^J ^j ^S ^s ^U ^u / ], | ||||||||||||||||||||||||||||
| 15 | apostrofoj => [ qw/ C' c' G' g' H' h' J' j' S' s' U' u' / ], | ||||||||||||||||||||||||||||
| 16 | iso => [ map chr, | ||||||||||||||||||||||||||||
| 17 | 198, 230, 216, 248, 166, 182, 172, 188, 222, 254, 221, 253 ], | ||||||||||||||||||||||||||||
| 18 | unikodo => [ map chr, | ||||||||||||||||||||||||||||
| 19 | 264, 265, 284, 285, 292, 293, 308, 309, 348, 349, 364, 365 ] | ||||||||||||||||||||||||||||
| 20 | ); | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 1 | ▶ | sub nova : New; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 23 | 1 | ▶ | sub de : Property { exists $cxapeloj{$_} } | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
de: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 24 | 1 | ▶ | sub al : Property { exists $cxapeloj{$_} } | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
al: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 25 | 0 | ▶ | sub u : Property { $_ = [ $_ ] if not ref $_; ref $_ eq 'ARRAY' or !defined } | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
Subroutine
u: not called CC=3 SCAR=17.3
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 26 | 0 | ▶ | sub U : Property { $_ = [ $_ ] if not ref $_; ref $_ eq 'ARRAY' or !defined } | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
Subroutine
U: not called CC=3 SCAR=17.3
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 9 | ▶ | sub transkodigu { | ||||||||||||||||||||||||||
|
Subroutine
transkodigu: called CC=12 SCAR=30.5
Pod
documented
| |||||||||||||||||||||||||||||
| 29 | 9 | my ($mem, @tekstoj) = (@_); | |||||||||||||||||||||||||||
| 30 | 9 | my ($de, $al, $u, $U) = ($mem->de, $mem->al, $mem->u, $mem->U); | |||||||||||||||||||||||||||
| 31 | 9 | ▶ | $U = [ map uc, @$u ] if $u and not $U; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$u and not $U
MC/DC0%0/2
$u and not $U
$u
not $U
Truth table33%1/3
A and not(B)
A= $uB= not $U
| |||||||||||||||||||||||||||||
| 32 | 9 | ▶ | $u = [ map lc, @$U ] if $U and not $u; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$U and not $u
MC/DC0%0/2
$U and not $u
$U
not $u
Truth table33%1/3
A and not(B)
A= $UB= not $u
| |||||||||||||||||||||||||||||
| 33 | 9 | ▶ | $de ||= 'X'; | ||||||||||||||||||||||||||
|
Condition50%1/2
$de ||= "X"
MC/DC0%0/1
$de ||= "X"
$de
Truth table50%1/2
A
A= $de
| |||||||||||||||||||||||||||||
| 34 | 9 | ▶ | $al ||= 'unikodo'; | ||||||||||||||||||||||||||
|
Condition50%1/2
$al ||= "unikodo"
MC/DC0%0/1
$al ||= "unikodo"
$al
Truth table50%1/2
A
A= $al
| |||||||||||||||||||||||||||||
| 35 | my $modelfolio = join '|', map quotemeta, | ||||||||||||||||||||||||||||
| 36 | $u | ||||||||||||||||||||||||||||
| 37 | 0 | ? (@{ $cxapeloj{$de} }[ 0 .. 9 ], @$u) | |||||||||||||||||||||||||||
| 38 | 9 | ▶ | : @{ $cxapeloj{$de} }; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 39 | my %transkodotabelo = | ||||||||||||||||||||||||||||
| 40 | 9 | map { ($cxapeloj{$de}[$_] => $cxapeloj{$al}[$_]) } 0 .. 11; | |||||||||||||||||||||||||||
| 41 | 9 | ▶ | if ($u) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 42 | 0 | delete @transkodotabelo{ @{ $cxapeloj{$de} }[10, 11] }; | |||||||||||||||||||||||||||
| 43 | 0 | $transkodotabelo{$_} = $cxapeloj{$al}[10] for @$U; | |||||||||||||||||||||||||||
| 44 | 0 | $transkodotabelo{$_} = $cxapeloj{$al}[11] for @$u; | |||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | 9 | @tekstoj = map { $_ =~ s/($modelfolio)/$transkodotabelo{$1}/g; $_ } @tekstoj; | |||||||||||||||||||||||||||
| 47 | 9 | ▶ | return wantarray ? @tekstoj : $tekstoj[-1]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 1 | 1; | |||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | __END__ | ||||||||||||||||||||||||||||