Ethiopic.pm

filter: Statementstmt 37.8% 115 / 304 Branchbran 23.9% 22 / 92 Conditioncond 27.5% 22 / 80 MC/DCmcdc 0.0% 0 / 38 Subroutinesub 42.2% 19 / 45 Podpod 3.2% 1 / 31 totaltotal 30.3% 179 / 590 CC 82 SCAR 35.8
CC
82
Cov
33%
tsomes
210.0
_isBogusEthiopicDate
34.7
new
31.0
CRAP 35.9
↑ Summary Ethiopic/ER/byn.pm »
1 package Date::Ethiopic;
2 1 ▶use base (Date::ICal);
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 BEGIN
6 1 ▶{
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 require 5.000;
8 1 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 ▶ use vars qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
12 $VERSION
13 $EPOCH
14  
15 @Tabots
16 @PagumeTabots
17 @PagumeTabotsTranscribed
18  
19 @YearNames
20  
21 @KokebDayNames
22 @KokebDayNamesTranscribed
23 @KokebMonthNames
24 @KokebMonthNamesTranscribed
25 @KokebYearNames
26 @KokebYearNamesTranscribed
27  
28 @EthiopicSeasonNames
29 @EthiopicSeasonNamesTranscribed
30  
31 @VariableTsomes
32 @VariableTsomesTranscribed
33 %VariableTsomes
34 %MiscellaneousTsomes
35 %MiscellaneousTsomesTranscribed
36 %MiscellaneousTsomes2
37 %MiscellaneousTsomes2Transcribed
38 %AnnualTsomes
39 %AnnualTsomesTranscribed
40 %LikaneTsomes
41 %LikaneTsomesTranscribed
42 %HawaryaTsomes
43 %HawaryaTsomesTranscribed
44 %StMaryTsomes
45 %StMaryTsomesTranscribed
46 %AksumTsomes
47 %AksumTsomesTranscribed
48  
49 $true
50 $false
51  
52 @GregorianDaysPerMonth
53  
54 $n
55 1 );
56  
57 1 $VERSION = "0.16";
58  
59 1 $EPOCH = 2796;
60  
61 1 ($false,$true) = (0,1);
62  
63 1 require Convert::Number::Ethiopic;
64 1 $n = new Convert::Number::Ethiopic;
65  
66 1 @GregorianDaysPerMonth = ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );
67  
68 1 @Tabots =(
69 [ "ልደታ", "Lideta" ],
70 [ "ታዴዎስና፡አባጉባ", "Tadiosna Abaguba" ],
71 [ "በአታ", "Beata" ],
72 [ "ዮሐንስ፡ሐዋርያው፡ወልደነጎድጓድ", "Yohannes : Hawariyaw : Weldenegodgwad" ],
73 [ "አቦ (አቡነ ገብረ ቅዱስ)", "Abo (Abune Gebre Kidus)" ],
74 [ "ኢያሱስ", "Yesus" ],
75 [ "ሥላሴ", "Selassie" ],
76 [ "አባ፡ኪሮስ", "Aba Kiros" ],
77 [ "ጨርቆስ", "Cherkos" ],
78 [ "መስቀል፡ኢየሱስ", "Meskel Yesus" ],
79 [ "ሐና፡ማርያም", "Hanna Mariam" ],
80 [ "ሚካኤል", "Michael" ],
81 [ "እግዚሐርአብ", "Egzihar Ab" ],
82 [ "አቡነ፡አረጋዊ", "Abune Aregawi" ],
83 [ "ጨርቆስ", "Cherkos" ],
84 [ "ኪዳነ፡ምሕረት", "Kidane Mihret" ],
85 [ "እስጢፋኖስ", "Estifanos" ],
86 [ "ቶማስ", "Tomas" ],
87 [ "ገብርኤል", "Gabriel" ],
88 [ "ሕንፅተ፡ቤተ፡ለማርያም", "Hinste Bete Lemariam" ],
89 [ "ማርያም", "Mariam" ],
90 [ "ኡራኤል", "Urael" ],
91 [ "ጊዮርጊስ", "Giorgis" ],
92 [ "ተክለ፡ሐይማኖት", "Tekle Haimanot" ],
93 [ "መርቆሪዎስ", "Merkoriwos" ],
94 [ "ዮሴፍ", "Yosef" ],
95 [ "መድኀኔ ዓለም", "Medehani Alem" ],
96 [ "አማኑኤል", "Amanuel" ],
97 [ "ባለ፡እግዚአብሔር", "Bale Egziabher" ],
98 [ "ዮሐንስ፡እና፡ማርቆስ", "Yohannes Ina Markos" ]
99 );
100 1 @PagumeTabots =(
101 "አሮጊቷ፡ልደታ",
102 "አሮጌ፡ታዴዎስና፡አባጉባ", # usual name
103 "ሩፋኤል",
104 "አሮጌ፡ዮሐንስ፡ሐዋርያው፡ወልደነጎድጓድ", # usual name
105 "አሮጌ፡አቦ (አቡነ፡ገብረ፡ቅዱስ)", # usual name
106 "አሮጌ፡ኢያሱስ" # usual name
107 );
108 1 @PagumeTabotsTranscribed =(
109 );
110 1 @VariableTsomes =(
111 "ነነዌ",
112 "በአታ ጾመ (ሁዳዴ የሚገባበት)",
113 "ደብረ ዘይት",
114 "ሆሣዕና",
115 "ስቅለት",
116 "ትንሣኤ",
117 "ረክበ ካህናት",
118 "ዕርገት",
119 "ጰራቅሊጦስ (ጰንጠቆስጤ)",
120 "ጾመ ሐዋርያት (የሰኔ ጾም)",
121 "ጾመ ድኅነት"
122 );
123 1 @VariableTsomesTranscribed =(
124 );
125 1 %VariableTsomes =(
126 "ነነዌ" => 0,
127 "በአታ ጾመ (ሁዳዴ የሚገባበት)" => 14,
128 "ደብረ ዘይት" => 41,
129 "ሆሣዕና" => 62,
130 "ስቅለት" => 67,
131 "ትንሣኤ" => 69,
132 "ረክበ ካህናት" => 93,
133 "ዕርገት" => 108,
134 "ጰራቅሊጦስ (ጰንጠቆስጤ)" => 118,
135 "ጾመ ሐዋርያት (የሰኔ ጾም)" => 119,
136 "ጾመ ድኅነት" => 121
137 );
138 1 %MiscellaneousTsomes =(
139 #
140 # ጾመ ገሀድ depends on the day ጥምቀት or ገና
141 # fall on (wed or fri), fix later.
142 #
143 "ጾመ ገሀድ" => [10,5],
144 "ማርያም" => [21,3]
145 );
146 1 %MiscellaneousTsomesTranscribed =(
147 );
148 1 %MiscellaneousTsomes2 =(
149 #
150 # we need a 2nd hash to avoid key clashes...
151 #
152 "ማርያም" => [21,9]
153 );
154 1 %MiscellaneousTsomes2Transcribed =(
155 );
156 #
157 # ዓመታዊ በዓል
158 #
159 1 %AnnualTsomes =(
160 "ርእስ ዓውደ ዓመት (እንቍጣጣሽ)" => [1,1],
161 "መስቀል (የመጣበት)" => [10,1],
162 "ደመራ" => [16,1],
163 "መስቀል (የተገኘበት)" => [17,1],
164 "ሚካአል" => [12,3],
165 "ጾመ ስብከት (የገና/የነቢያት ጾም)" => [15,3],
166 "ገብርኤል" => [19,4],
167 "ልደት" => [29,4],
168 "ግዝረት" => [6,5],
169 "ሥላሴ" => [7,5],
170 "ጥምቀት/ኤጲፋንያ" => [11,5],
171 "ቃና ዘገሊላ" => [12,5],
172 "ስምዖን" => [8,6],
173 "ገብርኤል" => [19,7],
174 "በዓለ መስቀል" => [10,7],
175 "መድኃኔ ዓለም" => [27,7],
176 "ትስብእት/በዓለ ወልድ" => [29,7],
177 "ጊዮርጊስ" => [23,8],
178 "ደብረ ታቦር (ቡሄ)" => [13,12]
179 );
180 1 %AnnualTsomesTranscribed =(
181 );
182 #
183 # የሊቃነ መላእክ ዕለት
184 #
185 1 %LikaneTsomes =(
186 "ራጉኤል" => [1,1],
187 "አፍኒን" => [8,3],
188 "ሚካኤል" => [12,3],
189 "ፋኑኤል" => [3,4],
190 "ሱርያል" => [27,5],
191 "ሳቁኤል" => [5,11],
192 "ኡራኤል" => [21,11],
193 "ሩፋኤል" => [3,13],
194 "አርባዕቱ እንስሳ" => [8,3],
195 "24ቱ ካህናተ ሰማይ" => [3,12],
196 );
197 1 %LikaneTsomesTranscribed =(
198 );
199 #
200 # የሐዋርያ/ወንጌላዊ በዓል
201 #
202 1 %HawaryaTsomes =(
203 "በርተሎሜዎስ" => [1,1],
204 "ማቴዎስ" => [12,2],
205 "እስጢፋኖስ" => [17,2],
206 "ሉቃስ" => [22,2],
207 "ፊሊጶስ" => [18,3],
208 "እንድርያስ" => [4,4],
209 "ዮሐንስ" => [4,5],
210 "ያዕቆብ ወልደ እልፍዮስ" => [10,6],
211 "ማትያስ" => [8,7],
212 "ያዕቆብ ወልደ ዘብዴዎስ" => [17,8],
213 "ማርቆስ" => [30,8],
214 "ቶማስ" => [26,9],
215 "ታዴዎስ" => [2,11],
216 "ጴጥሮስ ወጳውሎስ (የጾም ሐዋርያት ጾም መፍቻ)" => [5,11],
217 "ናትናኤል" => [10,11],
218 "ያዕቆብ የጌታ ወንድም" => [18,11]
219 );
220 1 %HawaryaTsomesTranscribed =(
221 );
222 #
223 # የቅድስት ማርያም በዓል =(
224 #
225 1 %StMaryTsomes =(
226 "ጼዴንያ" => [10,1],
227 "ደብረ ቍስቋም" => [6,3],
228 "በአታ" => [3,4],
229 "ድቅስዮስ" => [22,4],
230 "ገና" => [28,4],
231 "ልደት (ክርስቶስ የወለደችበት ዕለት)" => [29,4],
232 "ዕረፍት" => [21,5],
233 "ኪዳነ ምሕረት" => [16,6],
234 "ፅንሰት" => [29,7],
235 "ልደታ" => [1,9],
236 # genbot 24, 25?
237 # sene 8, 20 ?
238 "ጾም ፍልሰታ (የመቤታችን ጾም)" => [1,12], # check with ethiopica
239 "ቍጽረታ" => [7,12],
240 "ፍልሰታ (ኪዳነ ምሕረት) - የጾም መፍቻ" => [16,12], # check with book
241 "ሩፋኤል" => [3,13] # check with seattle group
242 );
243 1 %StMaryTsomesTranscribed =(
244 );
245 1 %AksumTsomes =(
246 "ጰንጠሌዎን" => [6,2],
247 "አረጋዊ/ዘሚካኤል" => [14,2],
248 "ይምአታ" => [28,2],
249 "ሊቃኖስ" => [25,3],
250 "ዖፅ" => [4,4],
251 "ሊባኖስ/መጣዕ" => [3,5],
252 "ጽሕማ" => [16,5],
253 "አሌፍ" => [11,7],
254 "አፍጼ" => [29,9],
255 "ጉባ" => [29,9],
256 "ይሥሐቅ/ገሪማ" => [17,10]
257 );
258 1 %AksumTsomesTranscribed =(
259 );
260 1 @YearNames =(
261 [ "ማቴዎስ", "Mateos" ],
262 [ "ማርቆስ", "Markos" ],
263 [ "ሉቃስ", "Lukas" ],
264 [ "ዮሐንስ", "Yohannes" ] # Leap Year
265 );
266 1 @KokebYearNames =(
267 "ምልክኤል",
268 "ሕልመልሜሌክ",
269 "ምልኤል",
270 "ናርኤል"
271 );
272 1 @KokebYearNamesTranscribed =(
273 );
274 1 @KokebDayNames =(
275 "አጣርድ",
276 "ዙሕራ",
277 "መሪሕ",
278 "መሽተሪ",
279 "ዙሐል",
280 "ኡራኑስ",
281 "ነይጡን"
282 );
283 1 @KokebDayNamesTranscribed =(
284 );
285 1 @KokebMonthNames =(
286 "ሚዛን",
287 "አቅራብ",
288 "ቀውስ",
289 "ጀደይ", # ጀዲ
290 "ደለው", # ደለዌ
291 "ሑት",
292 "ሐመል",
293 "ሠውር",
294 "ጀውዛ", # ገውዝ
295 "ሸርጣን",
296 "አሰድ",
297 "ሰንቡላ",
298 "ሰንቡላ" # Don't really know for ጳጉሜን
299 );
300 1 @KokebMonthNamesTranscribed =(
301 );
302 1 @EthiopicSeasonNames =(
303 "መጸው", # ከመስከረም ፳፭ እስከ ታኅሣሥ ፳፭
304 "ሐጋይ", # ክታኅሣሥ ፳፭ እስከ መጋቢት ፳፭
305 "ጸደይ", # ከመጋቢት ፳፭ እስከ ሰኔ ፳፭
306 "ክረምት" # ከሰኔ ፳፭ እስከ መስከረም ፳፭ # check this, its seems a
307 # a bit long for ክረምት
308 );
309 1 @EthiopicSeasonNamesTranscribed =(
310 );
311  
312 #
313 # Look into these later and how to calculate the days
314 #
315 #
316 # Islamic Holidays in Ethiopia
317 #
318 # የነቢዩ መሐመድ ልደት (መውሊድ) Birthday of Prophet Mohammed (Maulid)
319 # ኢድ አል ፈጥር (ረመዳን) Id Al Fetir (Remedan)
320 # ኢድ አል አድሐ (አረፋ) Id Al Adaha (Arefa)
321 #
322 # Islamic Holidays in Eritrea
323 #
324 # ልደተ ነቢዩ መሓመድ (መውሊድ) Birthday of Prophet Mohammed (Maulid)
325 # ዒድ ኣል ፈጥር (ረመዳን) Id Al-Fetir (Remedan)
326 # ዒድ ኣል ኣድሓ (ዓሪፋ) Id Al Adaha (Arefa)
327  
328 # ታቦት = \&tabot;
329 # ዘመነ = \&zemene;
330 # ጾመ = \&tsom;
331 }
332  
333  
334 sub new
335 2 ▶{
Subroutine new: called CC=12 SCAR=34.4
Pod documented
336 2 my $class = shift;
337 2 ▶my %args = @_ if ($#_);
Branch: 1 branch
BranchTrueFalseTotal
if $#_ 2 0 2
338 2 my $self;
339  
340  
341 2 ▶ if ( ref($_[0]) && $_[0]->isa ("Date::ICal") ) {
Branch: 2 branches
BranchTrueFalseTotal
if (ref $_[0] and $_[0]->isa('Date::ICal')) { } 0 2 2
elsif ($args{'calscale'}) { } 1 1 2
Condition33%1/3
ref $_[0] and $_[0]->isa("Date::ICal")
!ll&&!rl&&r
200
MC/DC0%0/2
ref $_[0] and $_[0]->isa("Date::ICal")
ref $_[0] $_[0]->isa("Date::ICal")
Truth table33%1/3
A and B
A= ref $_[0]B= $_[0]->isa("Date::ICal")
ABresult
0X0
100
111
342 #
343 # We assume a Gregorian calscale, though we should check it.
344 # Proposal a universal toGregorian or gregorian method to group.
345 #
346 0 my $ical = $_[0];
347 0 my $et = {}; bless $et, $class;
348 ( $args{day}, $args{month}, $args{year} )
349 0 = $et->fromGregorian ( $ical->day, $ical->month, $ical->year );
350 0 $self = $class->SUPER::new ( %args );
351 }
352 elsif ( $args{calscale} ) {
353 #
354 # A calender system has been specified:
355 #
356 1 ▶ if ( $args{calscale} =~ /gregorian/i ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($args{'calscale'} =~ /gregorian/i) { } 1 0 1
elsif ($args{'calscale'} =~ /ethio/i) { } 0 0 0
357 #
358 # We have been given dates in the Gregorian system
359 # so we must convert into Ethiopic
360 #
361 1 my $et = {}; bless $et, $class;
362 1 ▶ if ( $args{ical} || $args{epoch} ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($args{'ical'} or $args{'epoch'}) { } 0 1 1
elsif ($args{'day'} and $args{'month'} and $args{'year'}) { } 1 0 1
Condition33%1/3
$args{"ical"} or $args{"epoch"}
l!l&&r!l&&!r
001
MC/DC0%0/2
$args{"ical"} or $args{"epoch"}
$args{"ical"} $args{"epoch"}
Truth table33%1/3
A or B
A= $args{"ical"}B= $args{"epoch"}
ABresult
1X1
011
000
363 0 my $temp = $class->SUPER::new ( %args );
364 ( $args{day}, $args{month}, $args{year} )
365 0 = $et->fromGregorian ( $temp->day, $temp->month, $temp->year );
366 0 delete ( @args{'ical', 'epoch'} );
367 }
368 ▶ elsif ( $args{day} && $args{month} && $args{year} ) {
Condition33%2/6
$args{"day"} and $args{"month"} and $args{"year"}
!ll&&!rl&&r
001
$args{"day"} and $args{"month"}
!ll&&!rl&&r
001
MC/DC0%0/3
$args{"day"} and $args{"month"} and $args{"year"}
$args{"day"} $args{"month"} $args{"year"}
Truth table25%1/4
A and B and C
A= $args{"day"}B= $args{"month"}C= $args{"year"}
ABCresult
0XX0
10X0
1100
1111
369 ( $args{day}, $args{month}, $args{year} )
370 1 = $et->fromGregorian ( $args{day}, $args{month}, $args{year} );
371 }
372 else {
373 0 die ( "Useless Gregorian context, no date args passed.\n" );
374 }
375 1 $self = $class->SUPER::new ( %args );
376 }
377 elsif ( $args{calscale} =~ /ethio/i ) {
378 0 $self = $class->SUPER::new ( %args );
379 0 $self->_isBogusEthiopicDate;
380 }
381 else {
382 0 die ( "Aborting: unknown calscale '$args{calscale}'\n" );
383 }
384 }
385 else {
386 #
387 # The Ethiopic calender system is assumed when unspecified:
388 #
389 1 $self = $class->SUPER::new ( %args );
390 1 $self->_isBogusEthiopicDate;
391 }
392  
393 2 $self->{_trans} = $false;
394 2 $self->{_is_tsome} = $false;
395  
396 2 bless $self, $class;
397 }
398  
399  
400 #
401 #
402 # Calender System Conversion Methods Below Here:
403 #
404 #
405 sub _AbsoluteToEthiopic
406 1 ▶{
Subroutine _AbsoluteToEthiopic: called CC=1 SCAR=0.0
407 1 my ( $self, $absolute ) = @_;
408  
409 1 my $year = quotient ( 4 * ( $absolute - $EPOCH ) + 1463, 1461 );
410 1 my $month = 1 + quotient ( $absolute - $self->_EthiopicToAbsolute ( 1, 1, $year ), 30 );
411 1 my $day = ( $absolute - $self->_EthiopicToAbsolute ( 1, $month, $year ) + 1 );
412  
413 1 ( $day, $month, $year );
414 }
415  
416  
417 sub fromGregorian
418 1 ▶{
Subroutine fromGregorian: called CC=2 SCAR=7.1
Pod undocumented
419 1 my $self = shift;
420  
421 1 ▶ die ( "Bogus Ethiopic Date!!" ) if ( $self->_isBogusGregorianDate ( @_ ) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->_isBogusGregorianDate(@_) 0 1 1
422  
423 1 $self->_AbsoluteToEthiopic ( $self->_GregorianToAbsolute ( @_ ) );
424 }
425  
426  
427 sub gregorian
428 1 ▶{
Subroutine gregorian: called CC=1 SCAR=0.0
Pod undocumented
429 1 my $self = shift;
430  
431 1 $self->_AbsoluteToGregorian ( $self->_EthiopicToAbsolute ( @_ ) );
432 }
433  
434  
435 sub _isBogusEthiopicDate
436 1 ▶{
Subroutine _isBogusEthiopicDate: called CC=11 SCAR=35.5
437 1 my $self = shift;
438  
439 1 ▶ my($day, $month, $year) = (@_) ? @_ : ($self->day, $self->month, $self->year);
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 1 1
440  
441 1 ▶ ( !( 1 <= $day && $day <= 30 )
Branch: 1 branch
BranchTrueFalseTotal
!((1 <= $day && $day <= 30) && (1 <= $month && $month <= 13)) || $month == 13 && $day > 6 || $month == 13 && $day == 6 && !$self->isLeapYear ? : 0 1 1
Condition33%8/24
not +(1 <= $day && $day <= 30) && (1 <= $month && $month <= 13) or $month == 13 and $day > 6 or $month == 13 and $day == 6 and not $self->isLeapYear
l!l&&r!l&&!r
001
not +(1 <= $day && $day <= 30) && (1 <= $month && $month <= 13) or $month == 13 and $day > 6
l!l&&r!l&&!r
001
(1 <= $day && $day <= 30) && (1 <= $month && $month <= 13)
!ll&&!rl&&r
001
1 <= $day and $day <= 30
!ll&&!rl&&r
001
1 <= $month and $month <= 13
!ll&&!rl&&r
001
$month == 13 and $day > 6
!ll&&!rl&&r
100
$month == 13 and $day == 6 and not $self->isLeapYear
!ll&&!rl&&r
100
$month == 13 and $day == 6
!ll&&!rl&&r
100
MC/DC0%0/9
not +(1 <= $day && $day <= 30) && (1 <= $month && $month <= 13) or $month == 13 and $day > 6 or $month == 13 and $day == 6 and not $self->isLeapYear
1 <= $day $day <= 30 1 <= $month $month <= 13 $month == 13 $day > 6 $month == 13 $day == 6 not $self->isLeapYear
Truth table7%1/13
not(A and B && C and D) or E and F or G and H and not(I)
A= 1 <= $dayB= $day <= 30C= 1 <= $monthD= $month <= 13E= $month == 13F= $day > 6G= $month == 13H= $day == 6I= not $self->isLeapYear
ABCDEFGHIresult
0XXXXXXXX1
10XXXXXXX1
110XXXXXX1
1110XXXXX1
111111XXX1
11110X1111
1111101111
11110X0XX0
11110X10X0
11110X1100
1111100XX0
11111010X0
1111101100
442 || !( 1 <= $month && $month <= 13 )
443 || ( $month == 13 && $day > 6 )
444 || ( $month == 13 && $day == 6 && !$self->isLeapYear )
445 )
446 ?
447 $true : $false;
448  
449 }
450  
451  
452 sub _isBogusGregorianDate
453 1 ▶{
Subroutine _isBogusGregorianDate: called CC=9 SCAR=31.5
454 1 my $self = shift;
455  
456 1 ▶ my($day, $month, $year) = (@_) ? @_ : ($self->day, $self->month, $self->year);
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 1 0 1
457  
458 1 ▶ ( !( 1 <= $month && $month <= 12 )
Branch: 1 branch
BranchTrueFalseTotal
!((1 <= $month && $month <= 12) && (1 <= $day && $day <= $GregorianDaysPerMonth[$month - 1])) || $day == 29 && $month == 2 && !$self->_isGregorianLeapYear($year) ? : 0 1 1
Condition33%6/18
not +(1 <= $month && $month <= 12) && (1 <= $day && $day <= $GregorianDaysPerMonth[$month - 1]) or $day == 29 and $month == 2 and not $self->_isGregorianLeapYear($year)
l!l&&r!l&&!r
001
(1 <= $month && $month <= 12) && (1 <= $day && $day <= $GregorianDaysPerMonth[$month - 1])
!ll&&!rl&&r
001
1 <= $month and $month <= 12
!ll&&!rl&&r
001
1 <= $day and $day <= $GregorianDaysPerMonth[$month - 1]
!ll&&!rl&&r
001
$day == 29 and $month == 2 and not $self->_isGregorianLeapYear($year)
!ll&&!rl&&r
100
$day == 29 and $month == 2
!ll&&!rl&&r
100
MC/DC0%0/7
not +(1 <= $month && $month <= 12) && (1 <= $day && $day <= $GregorianDaysPerMonth[$month - 1]) or $day == 29 and $month == 2 and not $self->_isGregorianLeapYear($year)
1 <= $month $month <= 12 1 <= $day $day <= $GregorianDaysPerMonth[$month - 1] $day == 29 $month == 2 not $self->_isGregorianLeapYear($year)
Truth table12%1/8
not(A and B && C and D) or E and F and not(G)
A= 1 <= $monthB= $month <= 12C= 1 <= $dayD= $day <= $GregorianDaysPerMonth[$month - 1]E= $day == 29F= $month == 2G= not $self->_isGregorianLeapYear($year)
ABCDEFGresult
0XXXXXX1
10XXXXX1
110XXXX1
1110XXX1
11111111
11110XX0
111110X0
11111100
459 || !( 1 <= $day && $day <= $GregorianDaysPerMonth[$month-1] )
460 || ( $day == 29 && $month == 2 && !$self->_isGregorianLeapYear($year) )
461 )
462 ?
463 $true : $false;
464  
465 }
466  
467  
468 sub _EthiopicToAbsolute
469 3 ▶{
Subroutine _EthiopicToAbsolute: called CC=2 SCAR=6.9
470 3 my $self = shift;
471 3 ▶my ( $date, $month, $year ) = ( @_ ) ? @_ : ($self->day,$self->month,$self->year);
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 2 1 3
472  
473 3 ( $EPOCH - 1 + 365 * ( $year - 1 ) + quotient ( $year, 4 ) + 30 * ( $month - 1 ) + $date );
474 }
475  
476  
477 sub _GregorianYear
478 1 ▶{
Subroutine _GregorianYear: called CC=3 SCAR=11.2
479 1 my ( $a ) = @_;
480  
481 1 my $b = $a - 1;
482 1 my $c = quotient ( $b, 146097 );
483 1 my $d = mod ( $b, 146097 );
484 1 my $e = quotient ( $d, 36524 );
485 1 my $f = mod ( $d, 36524 );
486 1 my $g = quotient ( $f, 1461 );
487 1 my $h = mod ( $f, 1461 );
488 1 my $i = quotient ( $h, 365 );
489 1 my $j = ( 400 * $c ) + ( 100 * $e ) + ( 4 * $g ) + $i;
490  
491 1 ▶ ( ( $e == 4 ) || ( $i == 4 ) )
Branch: 1 branch
BranchTrueFalseTotal
$e == 4 || $i == 4 ? : 0 1 1
Condition33%1/3
$e == 4 or $i == 4
l!l&&r!l&&!r
001
MC/DC0%0/2
$e == 4 or $i == 4
$e == 4 $i == 4
Truth table33%1/3
A or B
A= $e == 4B= $i == 4
ABresult
1X1
011
000
492 ? $j
493 : ( $j + 1 )
494 ;
495 }
496  
497  
498 sub _AbsoluteToGregorian
499 1 ▶{
Subroutine _AbsoluteToGregorian: called CC=3 SCAR=11.2
500 1 my ( $self, $absolute ) = @_;
501  
502 1 my $year = _GregorianYear ( $absolute );
503  
504 1 my $priorDays = ( $absolute - $self->_GregorianToAbsolute ( 1, 1, $year ) );
505  
506 1 ▶ my $correction
Branch: 2 branches
BranchTrueFalseTotal
$absolute < $self->_GregorianToAbsolute(1, 3, $year) ? : 0 1 1
$self->_isGregorianLeapYear($year) ? : 0 1 1
507 = ( $absolute < $self->_GregorianToAbsolute ( 1, 3, $year ) )
508 ? 0
509 : ( $self->_isGregorianLeapYear ( $year ) )
510 ? 1
511 : 2
512 ;
513  
514 1 my $month = quotient ( ( ( 12 * ( $priorDays + $correction ) + 373 ) / 367 ), 1 );
515 1 my $day = $absolute - $self->_GregorianToAbsolute ( 1, $month, $year ) + 1;
516  
517 1 ( $day, $month, $year );
518 }
519  
520  
521 sub _GregorianToAbsolute
522 4 ▶{
Subroutine _GregorianToAbsolute: called CC=4 SCAR=14.1
523 4 my $self = shift;
524 4 ▶my ( $date, $month, $year ) = ( @_ ) ? @_ : ($self->day,$self->month,$self->year);
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 4 0 4
525  
526 4 ▶ my $correction
Branch: 2 branches
BranchTrueFalseTotal
$month <= 2 ? : 1 3 4
$self->_isGregorianLeapYear($year) ? : 0 3 3
527 = ( $month <= 2 )
528 ? 0
529 : ( $self->_isGregorianLeapYear ( $year ) )
530 ? -1
531 : -2
532 ;
533  
534 4 my $absolute =(
535 365 * ( $year - 1 )
536 + quotient ( $year - 1, 4 )
537 - quotient ( $year - 1, 100 )
538 + quotient ( $year - 1, 400 )
539 + ( 367 * $month - 362 ) / 12
540 + $correction + $date
541 );
542  
543 4 quotient ( $absolute, 1 );
544 }
545  
546  
547 sub _isGregorianLeapYear
548 4 ▶{
Subroutine _isGregorianLeapYear: called CC=5 SCAR=21.9
549 4 shift;
550  
551 (
552 4 ▶ ( ( $_[0] % 4 ) != 0 )
Branch: 1 branch
BranchTrueFalseTotal
$_[0] % 4 != 0 || $_[0] % 400 == 100 || $_[0] % 400 == 200 || $_[0] % 400 == 300 ? : 4 0 4
Condition33%3/9
$_[0] % 4 != 0 or $_[0] % 400 == 100 or $_[0] % 400 == 200 or $_[0] % 400 == 300
l!l&&r!l&&!r
400
$_[0] % 4 != 0 or $_[0] % 400 == 100 or $_[0] % 400 == 200
l!l&&r!l&&!r
400
$_[0] % 4 != 0 or $_[0] % 400 == 100
l!l&&r!l&&!r
400
MC/DC0%0/4
$_[0] % 4 != 0 or $_[0] % 400 == 100 or $_[0] % 400 == 200 or $_[0] % 400 == 300
$_[0] % 4 != 0 $_[0] % 400 == 100 $_[0] % 400 == 200 $_[0] % 400 == 300
Truth table20%1/5
A or B or C or D
A= $_[0] % 4 != 0B= $_[0] % 400 == 100C= $_[0] % 400 == 200D= $_[0] % 400 == 300
ABCDresult
1XXX1
01XX1
001X1
00011
00000
553 || ( ( $_[0] % 400 ) == 100 )
554 || ( ( $_[0] % 400 ) == 200 )
555 || ( ( $_[0] % 400 ) == 300 )
556 )
557 ? 0
558 : 1
559 ;
560 }
561  
562  
563 #
564 # argument is an ethiopic year
565 #
566 sub isLeapYear
567 0 ▶{
Subroutine isLeapYear: not called CC=3 SCAR=24.8
Pod undocumented
568 0 my $self = shift;
569 0 ▶my ( $year ) = ( @_ ) ? shift : $self->year;
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
570  
571 0 ▶ ( ( $year + 1 ) % 4 ) ? 0 : 1 ;
Branch: 1 branch
BranchTrueFalseTotal
($year + 1) % 4 ? : 0 0 0
572 }
573  
574  
575 sub quotient
576 29 ▶{
Subroutine quotient: called CC=1 SCAR=0.0
Pod undocumented
577 29 $_ = $_[0] / $_[1];
578  
579 29 s/\.(.*)//;
580  
581 29 $_;
582 }
583  
584  
585 sub mod
586 3 ▶{
Subroutine mod: called CC=1 SCAR=0.0
Pod undocumented
587 3 ( $_[0] - $_[1] * quotient ( $_[0], $_[1] ) );
588 }
589  
590  
591 #
592 # calscale and toGregorian and are methods I recommend every non-Gregorian
593 # based ICal package provide to identify itself and to convert the
594 # calendar system it handles into a normalized form.
595 #
596 sub calscale
597 0 ▶{
Subroutine calscale: not called CC=1 SCAR=6.9
Pod undocumented
598 0 "ethiopic";
599 }
600  
601  
602 sub toGregorian
603 0 ▶{
Subroutine toGregorian: not called CC=1 SCAR=6.9
Pod undocumented
604 0 my $self = shift;
605  
606 0 my ($day,$month,$year) = $self->gregorian;
607  
608 0 new Date::ICal ( day => $day, month => $month, year => $year );
609 }
610  
611  
612 sub format
613 0 ▶{
Subroutine format: not called CC=1 SCAR=6.9
Pod undocumented
614 0 my $self = shift;
615  
616 0 print "Ethiopic extended formatting is not yet implemented\n";
617 0 print "See: http://libeth.sourceforge.net/0.40/Dates.html\n";
618 0 return;
619  
620 0 $_ = shift;
621  
622 #
623 # see what's on libeth webpage
624 #
625 # http://libeth.sourceforge.net/0.40/Dates.html
626 #
627  
628 0 s/%M//; # replace with locale equivalent
629 0 s/%H//;
630 0 s/%Y//;
631 0 s/%EY//;
632 0 s/%m//;
633 0 s/%s//;
634 0 s/%EC//;
635 0 s/%Ey//;
636 0 s/%EY//;
637 0 s/%Od//;
638 0 s/%Oe//;
639 0 s/%OH//;
640 0 s/%OI//;
641 0 s/%Om//;
642 0 s/%Ou//;
643 0 s/%OU//;
644 0 s/%OV//;
645 0 s/%Ow//;
646 0 s/%OW//;
647 0 s/%Oy//;
648  
649 0 s/%-q//;
650 0 s/%-ta//;
651 0 s/%-ts//;
652 0 s/%-tsm//;
653 0 s/%-EN//;
654 0 s/%-ms//;
655 0 s/%-ys//;
656 0 s/%-sdm//;
657 0 s/%-sds//;
658  
659 }
660  
661  
662 sub full_date
663 0 ▶{
Subroutine full_date: not called CC=3 SCAR=24.8
Pod undocumented
664 0 my ($self) = shift;
665  
666 (@_)
667 ?
668 $self->day_name.$self->_sep.$self->month_name." ".$n->convert($self->day).$self->_daysep.$n->convert($self->year)." ".$self->ad
669 :
670 ( $self->{_trans} )
671 0 ▶ ?
Branch: 2 branches
BranchTrueFalseTotal
@_ ? : 0 0 0
$self->{'_trans'} ? : 0 0 0
672 $self->day_name(@_).$self->_sep.$self->month_name(@_)." ".$self->day.$self->_daysep.$self->year." ".$self->ad(@_)
673 :
674 $self->day_name.$self->_sep.$self->month_name." ".$self->day.$self->_daysep.$n->convert($self->year)." ".$self->ad
675 ;
676 }
677 sub long_date
678 0 ▶{
Subroutine long_date: not called CC=3 SCAR=24.8
Pod undocumented
679 0 my ($self) = shift;
680  
681 (@_)
682 ?
683 $n->convert($self->day)."-".$self->month_name."-".$n->convert($self->year)
684 :
685 ( $self->{_trans} )
686 0 ▶ ?
Branch: 2 branches
BranchTrueFalseTotal
@_ ? : 0 0 0
$self->{'_trans'} ? : 0 0 0
687 $self->day."-".$self->month_name(@_)."-".$self->year
688 :
689 $self->day."-".$self->month_name."-".$n->convert($self->year)
690 ;
691 }
692 sub medium_date
693 0 ▶{
Subroutine medium_date: not called CC=3 SCAR=24.8
Pod undocumented
694 0 my ($self) = @_;
695
696 0 my $year = $self->year;
697 0 $year =~ s/^\d\d//;
698  
699 ($#_)
700 ?
701 $self->day."-".$self->month_name."-".$n->convert($year)
702 :
703 ( $self->{_trans} )
704 0 ▶ ?
Branch: 2 branches
BranchTrueFalseTotal
$#_ ? : 0 0 0
$self->{'_trans'} ? : 0 0 0
705 $self->day."-".$self->month_name(@_)."-".$year
706 :
707 $n->convert($self->day)."-".$self->month_name."-".$n->convert($year)
708 ;
709 }
710 sub short_date
711 0 ▶{
Subroutine short_date: not called CC=1 SCAR=6.9
Pod undocumented
712 0 $self->day."/".$self->month."/".$self->year
713 }
714 sub full_time
715 0 ▶{
Subroutine full_time: not called CC=1 SCAR=0.0
Pod undocumented
716 }
717 sub medium_time
718 0 ▶{
Subroutine medium_time: not called CC=1 SCAR=0.0
Pod undocumented
719 }
720 sub short_time
721 0 ▶{
Subroutine short_time: not called CC=1 SCAR=0.0
Pod undocumented
722 }
723 sub date_time
724 0 ▶{
Subroutine date_time: not called CC=1 SCAR=0.0
Pod undocumented
725 }
726  
727  
728 sub day_name
729 0 ▶{
Subroutine day_name: not called CC=2 SCAR=17.9
Pod undocumented
730 0 my ( $self, $day ) = @_;
731  
732 0 ▶ $day ||= $self->_EthiopicToAbsolute;
Condition0%0/3
$day ||= $self->_EthiopicToAbsolute
l!l&&r!l&&!r
000
MC/DC0%0/2
$day ||= $self->_EthiopicToAbsolute
$day $self->_EthiopicToAbsolute
Truth table0%0/3
A ||= B
A= $dayB= $self->_EthiopicToAbsolute
ABresult
1X1
011
000
733  
734 0 $day %= 7;
735  
736 0 my $pkg = ref($self);
737  
738 0 ${"${pkg}::Days"}[$day][$self->{_trans}];
739 }
740  
741  
742 sub short_day_name
743 0 ▶{
Subroutine short_day_name: not called CC=2 SCAR=17.9
Pod undocumented
744 0 my ( $self, $day ) = @_;
745  
746 0 ▶ $day ||= $self->_EthiopicToAbsolute;
Condition0%0/3
$day ||= $self->_EthiopicToAbsolute
l!l&&r!l&&!r
000
MC/DC0%0/2
$day ||= $self->_EthiopicToAbsolute
$day $self->_EthiopicToAbsolute
Truth table0%0/3
A ||= B
A= $dayB= $self->_EthiopicToAbsolute
ABresult
1X1
011
000
747  
748 0 $day %= 7;
749  
750 0 my $pkg = ref($self);
751  
752 0 ${"${pkg}::ShortDays"}[$day][$self->{_trans}];
753 }
754  
755  
756 sub month_name
757 0 ▶{
Subroutine month_name: not called CC=2 SCAR=17.9
Pod undocumented
758 0 my ( $self, $month ) = @_;
759  
760 0 ▶ $month ||= $self->month;
Condition0%0/3
$month ||= $self->month
l!l&&r!l&&!r
000
MC/DC0%0/2
$month ||= $self->month
$month $self->month
Truth table0%0/3
A ||= B
A= $monthB= $self->month
ABresult
1X1
011
000
761  
762 0 $month -= 1;
763  
764 0 my $pkg = ref($self);
765  
766 0 ${"${pkg}::Months"}[$month][$self->{_trans}];
767 }
768  
769  
770 sub short_month_name
771 0 ▶{
Subroutine short_month_name: not called CC=2 SCAR=17.9
Pod undocumented
772 0 my ( $self, $month ) = @_;
773  
774 0 ▶ $month ||= $self->month;
Condition0%0/3
$month ||= $self->month
l!l&&r!l&&!r
000
MC/DC0%0/2
$month ||= $self->month
$month $self->month
Truth table0%0/3
A ||= B
A= $monthB= $self->month
ABresult
1X1
011
000
775  
776 0 $month -= 1;
777  
778 0 my $pkg = ref($self);
779  
780 0 ${"${pkg}::ShortMonths"}[$month][$self->{_trans}];
781 }
782  
783 #
784 #
785 # Methods for Language Independent Date Properites:
786 #
787 #
788  
789  
790 sub isTsomes
791 0 ▶{
Subroutine isTsomes: not called CC=1 SCAR=6.9
Pod undocumented
792 0 $_[0]->{_is_tsome};
793 }
794  
795  
796 sub tsomes
797 0 ▶{
Subroutine tsomes: not called CC=14 SCAR=53.5
Pod undocumented
798 0 my $self = shift;
799 0 ▶my ( $year ) = ( @_ ) ? shift : $self->year;
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
800  
801 0 my @Tsomes;
802 0 $#Tsomes = 50;
803 0 my $i = 0;
804  
805 0 my $pkg = ref($self);
806  
807 # Fixed Tsomes First
808 #
809 # Yuck... Lets simplify this later and get the tsomes sorted.
810 #
811 0 foreach my $key (keys %MiscellaneousTsomes) {
812 0 my $dm = $MiscellaneousTsomes{$key};
813 0 my $tsome = $pkg->new ( day => $dm->[0], month => $dm->[1], year => $year );
814 0 $tsome->{_tsome_name} = $key;
815 0 $tsome->{_tsome_category} = "misc"; # fix later
816 0 $tsome->{_is_tsome} = $true;
817 0 $Tsomes[$i++] = $tsome;
818 }
819 0 foreach my $key (keys %MiscellaneousTsomes2) {
820 0 my $dm = $MiscellaneousTsomes2{$key};
821 0 my $tsome = $pkg->new ( day => $dm->[0], month => $dm->[1], year => $year );
822 0 $tsome->{_tsome_name} = $key;
823 0 $tsome->{_tsome_category} = "misc"; # fix later
824 0 $tsome->{_is_tsome} = $true;
825 0 $Tsomes[$i++] = $tsome;
826 }
827 0 foreach my $key (keys %AnnualTsomes) {
828 0 my $dm = $AnnualTsomes{$key};
829 0 my $tsome = $pkg->new ( day => $dm->[0], month => $dm->[1], year => $year );
830 0 $tsome->{_tsome_name} = $key;
831 0 $tsome->{_tsome_category} = "ዓመታዊ በዓል";
832 0 $tsome->{_is_tsome} = $true;
833 0 $Tsomes[$i++] = $tsome;
834 }
835 0 foreach my $key (keys %LikaneTsomes) {
836 0 my $dm = $LikaneTsomes{$key};
837 0 my $tsome = $pkg->new ( day => $dm->[0], month => $dm->[1], year => $year );
838 0 $tsome->{_tsome_name} = $key;
839 0 $tsome->{_tsome_category} = "የሊቃነ መላእክ ዕለት";
840 0 $tsome->{_is_tsome} = $true;
841 0 $Tsomes[$i++] = $tsome;
842 }
843 0 foreach my $key (keys %HawaryaTsomes) {
844 0 my $dm = $HawaryaTsomes{$key};
845 0 my $tsome = $pkg->new ( day => $dm->[0], month => $dm->[1], year => $year );
846 0 $tsome->{_tsome_name} = $key;
847 0 $tsome->{_tsome_category} = "የሐዋርያ/ወንጌላዊ በዓል";
848 0 $tsome->{_is_tsome} = $true;
849 0 $Tsomes[$i++] = $tsome;
850 }
851 0 foreach my $key (keys %StMaryTsomes) {
852 0 my $dm = $StMaryTsomes{$key};
853 0 my $tsome = $pkg->new ( day => $dm->[0], month => $dm->[1], year => $year );
854 0 $tsome->{_tsome_name} = $key;
855 0 $tsome->{_tsome_category} = "የቅድስት ማርያም በዓል";
856 0 $tsome->{_is_tsome} = $true;
857 0 $Tsomes[$i++] = $tsome;
858 }
859 0 foreach my $key (keys %AksumTsomes) {
860 0 my $dm = $AksumeTsomes{$key};
861 0 my $tsome = $pkg->new ( day => $dm->[0], month => $dm->[1], year => $year );
862 0 $tsome->{_tsome_name} = $key;
863 0 $tsome->{_tsome_category} = "የአክሱም ዘመነ";
864 0 $tsome->{_is_tsome} = $true;
865 0 $Tsomes[$i++] = $tsome;
866 }
867  
868 #
869 # Computer Variable Tsomes
870 #
871 0 my $aa = 5500 + $year; # ዓመተ ዓለም
872 0 my $w = ($aa - 1) % 19; # ወምበር
873 0 my $ab = ($w * 11) % 30; # አበቅቴ
874 0 my $m = 30 - $ab; # መጥቅዕ
875  
876 0 ▶ my $wr = ($m < 15) ? 2 : 1; # ወር
Branch: 1 branch
BranchTrueFalseTotal
$m < 15 ? : 0 0 0
877  
878 0 my $ly = int (($aa - 1) / 4); # leap year
879  
880 0 ▶ my $p = ($year % 4) ? 0 : 1 ;
Branch: 1 branch
BranchTrueFalseTotal
$year % 4 ? : 0 0 0
881  
882 0 my $td = ($aa - 1) * 365 + $ly + $p;
883 0 my $s = (($td + 1) % 7) + 1;
884 0 my $tdm = $td + ($wr - 1) * 30 + $m;
885 0 my $d = (($tdm % 7) + 1);
886 0 my $f = 129 - ((($d + 1) % 7) + 1);
887  
888 0 foreach my $key (@VariableTsomes) {
889 0 my $tdbi = $tdm + $f + $VariableTsomes{$key};
890 0 my $wri = int(($tdbi - $td) / 30);
891 0 my $di = (($tdbi - $td) % 30);
892 0 ▶ $di ||= 30;
Condition0%0/2
$di ||= 30
l!l
00
MC/DC0%0/1
$di ||= 30
$di
Truth table0%0/2
A
A= $di
Aresult
11
00
893 0 ▶ $wri = $wri + 1 if ($di > 0);
Branch: 1 branch
BranchTrueFalseTotal
if $di > 0 0 0 0
894  
895 0 my $is = (($tdbi % 7) + 1);
896
897 0 my $tsome = $pkg->new ( day => $di, month => $wri, year => $year );
898 0 $tsome->{_tsome_name} = $key;
899 0 $Tsomes[$i++] = $tsome;
900 }
901  
902 0 @Tsomes;
903 }
904  
905  
906 sub dayStar
907 0 ▶{
Subroutine dayStar: not called CC=3 SCAR=24.8
Pod undocumented
908 0 my $self = shift;
909 0 ▶my ( $day ) = ( @_ ) ? shift : $self->day;
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
910  
911 0 ▶ ( $self->{_trans} ) ? $KokebDayNamesTranscribed[$day%7] : $KokebDayNames[$day%7] ;
Branch: 1 branch
BranchTrueFalseTotal
$self->{'_trans'} ? : 0 0 0
912  
913 }
914  
915  
916 sub monthStar
917 0 ▶{
Subroutine monthStar: not called CC=3 SCAR=24.8
Pod undocumented
918 0 my $self = shift;
919 0 ▶my ( $month ) = ( @_ ) ? shift : $self->month;
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
920  
921 0 ▶ ( $self->{_trans} ) ? $KokebMonthNamesTranscribed[$month%13] : $KokebMonthNames[$month%13] ;
Branch: 1 branch
BranchTrueFalseTotal
$self->{'_trans'} ? : 0 0 0
922 }
923  
924  
925 sub yearStar
926 0 ▶{
Subroutine yearStar: not called CC=3 SCAR=24.8
Pod undocumented
927 0 my $self = shift;
928 0 ▶my ( $year ) = ( @_ ) ? shift : $self->year;
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
929  
930 0 ▶ ( $self->{_trans} ) ? $KokebYearNamesTranscribed[$year%4] : $KokebYearNames[$year%4] ;
Branch: 1 branch
BranchTrueFalseTotal
$self->{'_trans'} ? : 0 0 0
931 }
932  
933  
934 sub season
935 0 ▶{
Subroutine season: not called CC=5 SCAR=34.0
Pod undocumented
936 0 my $self = shift;
937  
938 0 my ($day,$month) = ($self->day,$self->month);
939 0 my $season;
940 0 my $daysThusFar = ($month-1)*30 + $day;
941  
942 0 ▶ ( $daysThusFar < 25 )
Branch: 4 branches
BranchTrueFalseTotal
$daysThusFar < 25 ? : 0 0 0
$daysThusFar < 114 ? : 0 0 0
$daysThusFar < 204 ? : 0 0 0
$daysThusFar < 294 ? : 0 0 0
943 ? "ክረምት"
944 : ( $daysThusFar < (3*30+24) )
945 ? "መጸው"
946 : ( $daysThusFar < (6*30+24) )
947 ? "ሐጋይ"
948 : ( $daysThusFar < (9*30+24) )
949 ? "ጸደይ"
950 : "ክረምት"
951 ;
952  
953 }
954  
955  
956 sub tabot
957 0 ▶{
Subroutine tabot: not called CC=3 SCAR=24.8
Pod undocumented
958 0 my $self = shift;
959  
960 0 my ($day,$month) = ($self->day,$self->month);
961  
962 ( $month == 13 )
963 ? ( $self->{_trans} )
964 ? $PagumeTabotsTranscribed[$day]
965 : $PagumeTabots[$day]
966 0 ▶ : $Tabots[$day][$self->{_trans}]
Branch: 2 branches
BranchTrueFalseTotal
$month == 13 ? : 0 0 0
$self->{'_trans'} ? : 0 0 0
967 ;
968 }
969  
970  
971 sub zemene
972 0 ▶{
Subroutine zemene: not called CC=2 SCAR=17.9
Pod undocumented
973 0 my $self = shift;
974 0 ▶my ( $year ) = ( @_ ) ? shift : $self->year;
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
975  
976 0 $YearNames[($year%4)][$self->{_trans}];
977 }
978  
979  
980 0 ▶sub yearName { zemene(@_); }
Subroutine yearName: not called CC=1 SCAR=6.9
Pod undocumented
981  
982  
983 sub useTranscription
984 0 ▶{
Subroutine useTranscription: not called CC=2 SCAR=17.9
Pod undocumented
985 0 my $self = shift;
986  
987 0 ▶ $self->{_trans} = shift if (@_);
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
988  
989 0 $self->{_trans};
990 }
991  
992  
993 #########################################################
994 # Do not change this, Do not put anything below this.
995 # File must return "true" value at termination
996 1 1;
997 ##########################################################
998  
999 __END__
↑ Summary Ethiopic/ER/byn.pm »