| 1 | # For Emacs: -*- mode:cperl; eval: (folding-mode 1) -*- | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | package Lingua::AFR::Numbers; | ||||||||||||||||||||||||||||
| 4 | # ABSTRACT: This module is deprecated. Please use Lingua::AFR::Num2Word instead. | ||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use 5.16.0; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use utf8; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | # {{{ use block | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 1 | ▶ | use Export::Attrs; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | 1 | ▶ | use Lingua::AFR::Num2Word qw(num2afr_cardinal parse); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | # }}} | ||||||||||||||||||||||||||||
| 17 | # {{{ var block | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 1 | our $VERSION = '0.2603270'; | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | # }}} | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | # {{{ re-export from Num2Word | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 1 | ▶ | sub num2afr_cardinal :Export { goto &Lingua::AFR::Num2Word::num2afr_cardinal } | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
num2afr_cardinal: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | # }}} | ||||||||||||||||||||||||||||
| 28 | # {{{ new constructor (deprecated) | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 1 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=12.0
Pod
documented
| |||||||||||||||||||||||||||||
| 31 | 1 | my $class = shift; | |||||||||||||||||||||||||||
| 32 | 1 | my $number = shift; | |||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 1 | carp "Lingua::AFR::Numbers is deprecated, use Lingua::AFR::Num2Word instead"; | |||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 1 | my $self = bless {}, $class; | |||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 1 | ▶ | if (defined $number && $number =~ /^\d+$/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $number and $number =~ /^\d+$/u
MC/DC0%0/2
defined $number and $number =~ /^\d+$/u
defined $number
$number =~ /^\d+$/u
Truth table33%1/3
A and B
A= defined $numberB= $number =~ /^\d+$/u
| |||||||||||||||||||||||||||||
| 39 | 0 | return $self->parse($number); | |||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 1 | return $self; | |||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | # }}} | ||||||||||||||||||||||||||||
| 46 | # {{{ parse delegate to Num2Word (deprecated) | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 4 | ▶ | sub parse :Export { | ||||||||||||||||||||||||||
|
Subroutine
parse: called CC=4 SCAR=14.3
| |||||||||||||||||||||||||||||
| 49 | 4 | ▶ | my $self = ref($_[0]) ? shift : __PACKAGE__->new(); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 50 | 4 | ▶ | my $number = shift // return ''; | ||||||||||||||||||||||||||
|
Condition100%2/2
shift() // (return "")
MC/DC100%1/1
shift() // (return "")
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | 3 | ▶ | return num2afr_cardinal($number) // ''; | ||||||||||||||||||||||||||
|
Condition50%1/2
num2afr_cardinal($number) // ""
MC/DC0%0/1
num2afr_cardinal($number) // ""
num2afr_cardinal($number)
Truth table50%1/2
A
A= num2afr_cardinal($number)
| |||||||||||||||||||||||||||||
| 53 | 1 | ▶ | } | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | # }}} | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 1 | 1; | |||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | __END__ | ||||||||||||||||||||||||||||