| 1 | package Lingua::AF::Numbers; | ||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||
| 3 | 1 | $VERSION = '1.2'; | |||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||
| 7 | 1 | my $numbers = { | |||||||||||||||||||||||||||||||||
| 8 | 0 => 'nul', | ||||||||||||||||||||||||||||||||||
| 9 | 1 => 'een', | ||||||||||||||||||||||||||||||||||
| 10 | 2 => 'twee', | ||||||||||||||||||||||||||||||||||
| 11 | 3 => 'drie', | ||||||||||||||||||||||||||||||||||
| 12 | 4 => 'vier', | ||||||||||||||||||||||||||||||||||
| 13 | 5 => 'vyf', | ||||||||||||||||||||||||||||||||||
| 14 | 6 => 'ses', | ||||||||||||||||||||||||||||||||||
| 15 | 7 => 'sewe', | ||||||||||||||||||||||||||||||||||
| 16 | 8 => 'agt', | ||||||||||||||||||||||||||||||||||
| 17 | 9 => 'nege', | ||||||||||||||||||||||||||||||||||
| 18 | 10 => 'tien', | ||||||||||||||||||||||||||||||||||
| 19 | 11 => 'elf', | ||||||||||||||||||||||||||||||||||
| 20 | 12 => 'twaalf', | ||||||||||||||||||||||||||||||||||
| 21 | 13 => 'dertien', | ||||||||||||||||||||||||||||||||||
| 22 | 14 => 'viertien', | ||||||||||||||||||||||||||||||||||
| 23 | 15 => 'vyftien', | ||||||||||||||||||||||||||||||||||
| 24 | 16 => 'sestien', | ||||||||||||||||||||||||||||||||||
| 25 | 17 => 'sewentien', | ||||||||||||||||||||||||||||||||||
| 26 | 18 => 'agtien', | ||||||||||||||||||||||||||||||||||
| 27 | 19 => 'negentien', | ||||||||||||||||||||||||||||||||||
| 28 | 20 => 'twintig', | ||||||||||||||||||||||||||||||||||
| 29 | 30 => 'dertig', | ||||||||||||||||||||||||||||||||||
| 30 | 40 => 'viertig', | ||||||||||||||||||||||||||||||||||
| 31 | 50 => 'vyftig', | ||||||||||||||||||||||||||||||||||
| 32 | 60 => 'sestig', | ||||||||||||||||||||||||||||||||||
| 33 | 70 => 'sewentig', | ||||||||||||||||||||||||||||||||||
| 34 | 80 => 'tagtig', | ||||||||||||||||||||||||||||||||||
| 35 | 90 => 'negentig', | ||||||||||||||||||||||||||||||||||
| 36 | }; | ||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||
| 38 | sub new | ||||||||||||||||||||||||||||||||||
| 39 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 40 | 0 | my $class = shift; | |||||||||||||||||||||||||||||||||
| 41 | 0 | ▶ | my $number = shift || ''; | ||||||||||||||||||||||||||||||||
|
Condition0%0/2
shift() || ''
MC/DC0%0/1
shift() || ''
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||
| 43 | 0 | my $self = {}; | |||||||||||||||||||||||||||||||||
| 44 | 0 | bless $self, $class; | |||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||
| 46 | 0 | ▶ | if( $number =~ /\d+/ ) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 47 | 0 | return( $self->parse($number) ); | |||||||||||||||||||||||||||||||||
| 48 | }; | ||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||
| 50 | 0 | return( $self ); | |||||||||||||||||||||||||||||||||
| 51 | }; | ||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||
| 54 | sub parse | ||||||||||||||||||||||||||||||||||
| 55 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||
|
Subroutine
parse: not called CC=24 SCAR=64.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 56 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 57 | 0 | my $number = shift; | |||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||
| 59 | 0 | my $digits; | |||||||||||||||||||||||||||||||||
| 60 | 0 | my $ret = ''; | |||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||
| 62 | 0 | ▶ | if( defined($numbers->{$number}) ) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 63 | 0 | $ret = $numbers->{$number}; | |||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||||
| 65 | else { | ||||||||||||||||||||||||||||||||||
| 66 | 0 | my $ret_array = []; | |||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||
| 68 | 0 | @{$digits} = reverse( split('', $number) ); | |||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||
| 70 | # tens of billions | ||||||||||||||||||||||||||||||||||
| 71 | 0 | ▶ | if( defined($digits->[10]) && ($digits->[10] != 0) ) { | ||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
defined $digits->[10] and $digits->[10] != 0
MC/DC0%0/2
defined $digits->[10] and $digits->[10] != 0
defined $digits->[10]
$digits->[10] != 0
Truth table0%0/3
A and B
A= defined $digits->[10]B= $digits->[10] != 0
| |||||||||||||||||||||||||||||||||||
| 72 | 0 | my $temp = $self->_formatTens( $digits->[9], $digits->[10] ); | |||||||||||||||||||||||||||||||||
| 73 | 0 | unshift @{$ret_array}, "$temp biljoen"; | |||||||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||||||||
| 75 | ▶ | elsif( defined($digits->[9]) && ($digits->[9] != 0) ) { | |||||||||||||||||||||||||||||||||
|
Condition0%0/3
defined $digits->[9] and $digits->[9] != 0
MC/DC0%0/2
defined $digits->[9] and $digits->[9] != 0
defined $digits->[9]
$digits->[9] != 0
Truth table0%0/3
A and B
A= defined $digits->[9]B= $digits->[9] != 0
| |||||||||||||||||||||||||||||||||||
| 76 | 0 | unshift @{$ret_array}, $self->_formatLarge( $digits->[9], 'biljoen' ); | |||||||||||||||||||||||||||||||||
| 77 | }; | ||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||
| 79 | # hundreds of millions | ||||||||||||||||||||||||||||||||||
| 80 | 0 | ▶ | if( defined($digits->[8]) && ($digits->[8] != 0) ) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $digits->[8] and $digits->[8] != 0
MC/DC0%0/2
defined $digits->[8] and $digits->[8] != 0
defined $digits->[8]
$digits->[8] != 0
Truth table0%0/3
A and B
A= defined $digits->[8]B= $digits->[8] != 0
| |||||||||||||||||||||||||||||||||||
| 81 | 0 | ▶ | if( ($digits->[7] == 0) && ($digits->[6] == 0) ) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$digits->[7] == 0 and $digits->[6] == 0
MC/DC0%0/2
$digits->[7] == 0 and $digits->[6] == 0
$digits->[7] == 0
$digits->[6] == 0
Truth table0%0/3
A and B
A= $digits->[7] == 0B= $digits->[6] == 0
| |||||||||||||||||||||||||||||||||||
| 82 | 0 | unshift @{$ret_array}, $self->_formatLarge( $digits->[8], 'honderd miljoen' ); | |||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||
| 84 | else { | ||||||||||||||||||||||||||||||||||
| 85 | 0 | unshift @{$ret_array}, $self->_formatLarge( $digits->[8], 'honderd' ); | |||||||||||||||||||||||||||||||||
| 86 | }; | ||||||||||||||||||||||||||||||||||
| 87 | }; | ||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||
| 89 | # tens of millions | ||||||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | if( defined($digits->[7]) && ($digits->[7] != 0) ) { | ||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
defined $digits->[7] and $digits->[7] != 0
MC/DC0%0/2
defined $digits->[7] and $digits->[7] != 0
defined $digits->[7]
$digits->[7] != 0
Truth table0%0/3
A and B
A= defined $digits->[7]B= $digits->[7] != 0
| |||||||||||||||||||||||||||||||||||
| 91 | 0 | my $temp = $self->_formatTens( $digits->[6], $digits->[7] ); | |||||||||||||||||||||||||||||||||
| 92 | 0 | unshift @{$ret_array}, "$temp miljoen"; | |||||||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||||||||
| 94 | ▶ | elsif( defined($digits->[6]) && ($digits->[6] != 0) ) { | |||||||||||||||||||||||||||||||||
|
Condition0%0/3
defined $digits->[6] and $digits->[6] != 0
MC/DC0%0/2
defined $digits->[6] and $digits->[6] != 0
defined $digits->[6]
$digits->[6] != 0
Truth table0%0/3
A and B
A= defined $digits->[6]B= $digits->[6] != 0
| |||||||||||||||||||||||||||||||||||
| 95 | 0 | unshift @{$ret_array}, $self->_formatLarge( $digits->[6], 'miljoen' ); | |||||||||||||||||||||||||||||||||
| 96 | }; | ||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||
| 98 | # hundreds of thousands | ||||||||||||||||||||||||||||||||||
| 99 | 0 | ▶ | if( defined($digits->[5]) && ($digits->[5] != 0) ) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $digits->[5] and $digits->[5] != 0
MC/DC0%0/2
defined $digits->[5] and $digits->[5] != 0
defined $digits->[5]
$digits->[5] != 0
Truth table0%0/3
A and B
A= defined $digits->[5]B= $digits->[5] != 0
| |||||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | if( ($digits->[4] == 0) && ($digits->[3] == 0) ) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$digits->[4] == 0 and $digits->[3] == 0
MC/DC0%0/2
$digits->[4] == 0 and $digits->[3] == 0
$digits->[4] == 0
$digits->[3] == 0
Truth table0%0/3
A and B
A= $digits->[4] == 0B= $digits->[3] == 0
| |||||||||||||||||||||||||||||||||||
| 101 | 0 | unshift @{$ret_array}, $self->_formatLarge( $digits->[5], 'honderd duisend' ); | |||||||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||||||||
| 103 | else { | ||||||||||||||||||||||||||||||||||
| 104 | 0 | unshift @{$ret_array}, $self->_formatLarge( $digits->[5], 'honderd' ); | |||||||||||||||||||||||||||||||||
| 105 | }; | ||||||||||||||||||||||||||||||||||
| 106 | }; | ||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||
| 108 | # tens of thousands | ||||||||||||||||||||||||||||||||||
| 109 | 0 | ▶ | if( defined($digits->[4]) && ($digits->[4] != 0) ) { | ||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
defined $digits->[4] and $digits->[4] != 0
MC/DC0%0/2
defined $digits->[4] and $digits->[4] != 0
defined $digits->[4]
$digits->[4] != 0
Truth table0%0/3
A and B
A= defined $digits->[4]B= $digits->[4] != 0
| |||||||||||||||||||||||||||||||||||
| 110 | 0 | my $temp = $self->_formatTens( $digits->[3], $digits->[4] ); | |||||||||||||||||||||||||||||||||
| 111 | 0 | unshift @{$ret_array}, "$temp duisend"; | |||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||||
| 113 | ▶ | elsif( defined($digits->[3]) && ($digits->[3] != 0) ) { | |||||||||||||||||||||||||||||||||
|
Condition0%0/3
defined $digits->[3] and $digits->[3] != 0
MC/DC0%0/2
defined $digits->[3] and $digits->[3] != 0
defined $digits->[3]
$digits->[3] != 0
Truth table0%0/3
A and B
A= defined $digits->[3]B= $digits->[3] != 0
| |||||||||||||||||||||||||||||||||||
| 114 | 0 | unshift @{$ret_array}, $self->_formatLarge( $digits->[3], 'duisend' ); | |||||||||||||||||||||||||||||||||
| 115 | }; | ||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||
| 117 | # hundreds | ||||||||||||||||||||||||||||||||||
| 118 | 0 | ▶ | if( defined($digits->[2]) && ($digits->[2] != 0) ) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $digits->[2] and $digits->[2] != 0
MC/DC0%0/2
defined $digits->[2] and $digits->[2] != 0
defined $digits->[2]
$digits->[2] != 0
Truth table0%0/3
A and B
A= defined $digits->[2]B= $digits->[2] != 0
| |||||||||||||||||||||||||||||||||||
| 119 | 0 | unshift @{$ret_array}, $self->_formatLarge( $digits->[2], 'honderd' ); | |||||||||||||||||||||||||||||||||
| 120 | }; | ||||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||||
| 122 | # tens | ||||||||||||||||||||||||||||||||||
| 123 | 0 | unshift @{$ret_array}, $self->_formatTens( $digits->[0], $digits->[1] ); | |||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||
| 125 | 0 | $ret = $self->_sortReturn( $ret_array, $digits ); | |||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||
| 127 | }; | ||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||
| 129 | 0 | return( $ret ); | |||||||||||||||||||||||||||||||||
| 130 | }; | ||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||
| 133 | sub _sortReturn | ||||||||||||||||||||||||||||||||||
| 134 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||
|
Subroutine
_sortReturn: not called CC=12 SCAR=50.5
| |||||||||||||||||||||||||||||||||||
| 135 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 136 | 0 | my $ret_array = shift; | |||||||||||||||||||||||||||||||||
| 137 | 0 | my $digits = shift; | |||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||
| 139 | 0 | my $large_nums = 0; | |||||||||||||||||||||||||||||||||
| 140 | 0 | my $ret = ''; | |||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||
| 142 | 0 | my $size = @{$ret_array}; | |||||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||||
| 144 | 0 | ▶ | if( $size == 1 ) { | ||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||
| 145 | 0 | return( $ret_array->[0] ); | |||||||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||||||
| 147 | elsif( $size > 1 ) { | ||||||||||||||||||||||||||||||||||
| 148 | 0 | $large_nums = 1; | |||||||||||||||||||||||||||||||||
| 149 | }; | ||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||
| 151 | 0 | ▶ | for( my $i = $size; $i > 0; $i-- ) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 152 | 0 | ▶ | if( defined($ret_array->[$i]) ) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 153 | 0 | ▶ | if( $ret_array->[$i] =~ /(miljoen|duisend)/ ) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 154 | 0 | $ret .= $ret_array->[$i] .', '; | |||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||
| 156 | else { | ||||||||||||||||||||||||||||||||||
| 157 | 0 | $ret .= $ret_array->[$i] .' '; | |||||||||||||||||||||||||||||||||
| 158 | }; | ||||||||||||||||||||||||||||||||||
| 159 | }; | ||||||||||||||||||||||||||||||||||
| 160 | }; | ||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||
| 162 | 0 | ▶ | if( ($digits->[0] == 0) && ($digits->[1] == 0) ) { | ||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
$digits->[0] == 0 and $digits->[1] == 0
MC/DC0%0/2
$digits->[0] == 0 and $digits->[1] == 0
$digits->[0] == 0
$digits->[1] == 0
Truth table0%0/3
A and B
A= $digits->[0] == 0B= $digits->[1] == 0
| |||||||||||||||||||||||||||||||||||
| 163 | # do nothing | ||||||||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||||||||
| 165 | ▶ | elsif( ($digits->[0] == 0) || ($digits->[1] == 0) || ($digits->[1] == 1) ) { | |||||||||||||||||||||||||||||||||
|
Condition0%0/6
$digits->[0] == 0 or $digits->[1] == 0 or $digits->[1] == 1
$digits->[0] == 0 or $digits->[1] == 0
MC/DC0%0/3
$digits->[0] == 0 or $digits->[1] == 0 or $digits->[1] == 1
$digits->[0] == 0
$digits->[1] == 0
$digits->[1] == 1
Truth table0%0/4
A or B or C
A= $digits->[0] == 0B= $digits->[1] == 0C= $digits->[1] == 1
| |||||||||||||||||||||||||||||||||||
| 166 | 0 | ▶ | if( $large_nums ) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 167 | 0 | $ret .= ' en '; | |||||||||||||||||||||||||||||||||
| 168 | }; | ||||||||||||||||||||||||||||||||||
| 169 | 0 | $ret .= $ret_array->[0]; | |||||||||||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||||||||||
| 171 | else { | ||||||||||||||||||||||||||||||||||
| 172 | 0 | $ret .= ' '. $ret_array->[0]; | |||||||||||||||||||||||||||||||||
| 173 | }; | ||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||
| 175 | 0 | $ret =~ s/(^ |\s{2,}| $)/ /g; | |||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||
| 177 | 0 | return( $ret ); | |||||||||||||||||||||||||||||||||
| 178 | }; | ||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||
| 181 | sub _formatTens | ||||||||||||||||||||||||||||||||||
| 182 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||
|
Subroutine
_formatTens: not called CC=6 SCAR=37.4
| |||||||||||||||||||||||||||||||||||
| 183 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 184 | 0 | my $units = shift; | |||||||||||||||||||||||||||||||||
| 185 | 0 | my $tens = shift; | |||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||
| 187 | # Both digits are zero | ||||||||||||||||||||||||||||||||||
| 188 | 0 | ▶ | unless( $units || $tens ) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$units or $tens
MC/DC0%0/2
$units or $tens
$units
$tens
Truth table0%0/3
A or B
A= $unitsB= $tens
| |||||||||||||||||||||||||||||||||||
| 189 | 0 | return; | |||||||||||||||||||||||||||||||||
| 190 | }; | ||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||
| 192 | 0 | ▶ | if( $tens == 0 ) { | ||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||
| 193 | 0 | return( $numbers->{$units} ); | |||||||||||||||||||||||||||||||||
| 194 | } | ||||||||||||||||||||||||||||||||||
| 195 | ▶ | elsif( ($tens == 1) || ($units == 0) ) { | |||||||||||||||||||||||||||||||||
|
Condition0%0/3
$tens == 1 or $units == 0
MC/DC0%0/2
$tens == 1 or $units == 0
$tens == 1
$units == 0
Truth table0%0/3
A or B
A= $tens == 1B= $units == 0
| |||||||||||||||||||||||||||||||||||
| 196 | 0 | my $temp = $tens . $units; | |||||||||||||||||||||||||||||||||
| 197 | 0 | return( $numbers->{$temp} ); | |||||||||||||||||||||||||||||||||
| 198 | }; | ||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||
| 200 | 0 | my $temp = $tens . 0; | |||||||||||||||||||||||||||||||||
| 201 | 0 | return( "$numbers->{$units} en $numbers->{$temp}" ); | |||||||||||||||||||||||||||||||||
| 202 | }; | ||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||||||
| 205 | sub _formatLarge | ||||||||||||||||||||||||||||||||||
| 206 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||
|
Subroutine
_formatLarge: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||
| 207 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 208 | 0 | my $digit = shift; | |||||||||||||||||||||||||||||||||
| 209 | 0 | my $word = shift; | |||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||||
| 211 | 0 | my $ret = "$numbers->{$digit} $word"; | |||||||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||||||||
| 213 | 0 | return( $ret ); | |||||||||||||||||||||||||||||||||
| 214 | }; | ||||||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||
| 219 | 1 | 1; | |||||||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||||||||
| 221 | =pod | ||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||
| 223 | =head1 NAME | ||||||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||||||
| 225 | Lingua::AF::Numbers - Perl module for converting numeric values into their Afrikaans equivalents | ||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||||||
| 228 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||||
| 230 | Initial release, documentation and updates will follow. | ||||||||||||||||||||||||||||||||||
| 231 | |||||||||||||||||||||||||||||||||||
| 232 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||||
| 234 | use Lingua::AF::Numbers; | ||||||||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||||||||
| 236 | my $numbers = Lingua::AF::Numbers->new; | ||||||||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||||||
| 238 | my $text = $numbers->parse( 123 ); | ||||||||||||||||||||||||||||||||||
| 239 | |||||||||||||||||||||||||||||||||||
| 240 | # prints 'een honderd, drie en twintig' | ||||||||||||||||||||||||||||||||||
| 241 | print $text; | ||||||||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||||||||
| 244 | =head1 KNOWN BUGS | ||||||||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||||||||
| 246 | None, but that does not mean there are not any. | ||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||
| 248 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||||||||
| 250 | Alistair Francis, http://search.cpan.org/~friffin/ | ||||||||||||||||||||||||||||||||||
| 251 | |||||||||||||||||||||||||||||||||||
| 252 | =cut | ||||||||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||||||||