Ita2heb.pm

filter: Statementstmt 100% 39 / 39 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod 100% 2 / 2 totaltotal 100% 53 / 53 CC 3 SCAR 4.1
CC
3
Cov
100%
ita_to_heb
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« Ita2heb/LettersSeq.pm ↑ Summary Ita2heb/Role/Constants.pm »
1 package Lingua::IT::Ita2heb;
2  
3 11 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 11 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 11 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 11 ▶use charnames ':full';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 11 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 11 ▶use List::MoreUtils ();
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 11 ▶use Lingua::IT::Ita2heb::LettersSeq::IT::ToHeb;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 11 our $VERSION = '0.01';
17  
18 102 ▶sub ita_to_heb {
Subroutine ita_to_heb: called CC=3 SCAR=11.0
Pod documented
19 102 my ($ita, %option) = @_;
20  
21 102 my @ita_letters = split qr//xms, lc $ita;
22  
23 102 my $seq = Lingua::IT::Ita2heb::LettersSeq::IT::ToHeb->new(
24 {
25 ita_letters => \@ita_letters,
26 %option,
27 }
28 );
29  
30 # Recursion on punctuation marks.
31 #<<<
32 102 foreach my $punctuation (
33 [ qr/[ ]/xms, q{ }, ], # space
34 [ qr{-}xms, $seq->maqaf, ], # hyphen
35 [ qr{'}xms, q{'}, ]) # apostrophe
36 {
37 300 my ($re, $replacement) = @{$punctuation};
38 300 ▶ if ($ita =~ $re) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ita =~ /$re/) 7 293 300
39 7 return join $replacement, map { ita_to_heb($_) } split $re, $ita;
40 }
41 }
42 #>>>
43  
44 95 $seq->main_loop;
45  
46 95 return $seq->total_text;
47 }
48  
49 5 ▶sub closed_syllable {
Subroutine closed_syllable: called CC=1 SCAR=0.0
Pod documented
50 5 my ($letters_ref, $letter_index) = @_;
51  
52 5 my $seq = Lingua::IT::Ita2heb::LettersSeq::IT::ToHeb->new(
53 {
54 ita_letters => $letters_ref,
55 idx => $letter_index,
56 },
57 );
58  
59 5 return $seq->closed_syllable();
60 }
61  
62 11 1; # End of Lingua::IT::Ita2heb
63  
64 __END__
« Ita2heb/LettersSeq.pm ↑ Summary Ita2heb/Role/Constants.pm »