| 1 | package Lingua::SA; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 10 | ▶ | use 5.008; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 10 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 10 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 10 | ▶ | use English qw{-no_match_vars}; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 10 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | 10 | require Exporter; | |||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | 10 | our @ISA = qw(Exporter); | |||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | # Items to export into callers namespace by default. Note: do not export | ||||||||||||||||||||||||||||||||||||||||||
| 14 | # names by default without a very good reason. Use EXPORT_OK instead. | ||||||||||||||||||||||||||||||||||||||||||
| 15 | # Do not simply export all your public functions/methods/constants. | ||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | # This allows declaration use Lingua::SA ':all'; | ||||||||||||||||||||||||||||||||||||||||||
| 18 | # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK | ||||||||||||||||||||||||||||||||||||||||||
| 19 | # will save memory. | ||||||||||||||||||||||||||||||||||||||||||
| 20 | 10 | our %EXPORT_TAGS = ( 'all' => [ qw( | |||||||||||||||||||||||||||||||||||||||||
| 21 | transliterate | ||||||||||||||||||||||||||||||||||||||||||
| 22 | vibhakti | ||||||||||||||||||||||||||||||||||||||||||
| 23 | sandhi | ||||||||||||||||||||||||||||||||||||||||||
| 24 | ) ] ); | ||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | 10 | our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); | |||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | 10 | our @EXPORT = qw( | |||||||||||||||||||||||||||||||||||||||||
| 29 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | 10 | our $VERSION = '0.08'; | |||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | # Preloaded methods go here. | ||||||||||||||||||||||||||||||||||||||||||
| 34 | ########################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 35 | 2303 | ▶ | sub sandhi{ | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
sandhi: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 36 | 2303 | my ($in)=@_; | |||||||||||||||||||||||||||||||||||||||||
| 37 | 2303 | $in=~s/ \+ ([^\[])/$1/g; # replace + and surround spaces with nothing | |||||||||||||||||||||||||||||||||||||||||
| 38 | 2303 | $in=~s/aa/A/g; # replace aa with A | |||||||||||||||||||||||||||||||||||||||||
| 39 | 2303 | $in=~s/ii/I/g; # replace ii with I | |||||||||||||||||||||||||||||||||||||||||
| 40 | 2303 | $in=~s/uu/U/g; # replace uu with U | |||||||||||||||||||||||||||||||||||||||||
| 41 | 2303 | $in=~s/Ru/R/g; # replace Ru with R | |||||||||||||||||||||||||||||||||||||||||
| 42 | 2303 | return $in; | |||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||
| 44 | ########################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 45 | 467 | ▶ | sub vibhakti { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
vibhakti: called CC=18 SCAR=28.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 46 | ####### This is currently only for svaraanta (halant will be 8000+) | ||||||||||||||||||||||||||||||||||||||||||
| 47 | # USAGE: my $response=vibhakti({naam=>$noun, vibhakti=>$vibhakti, | ||||||||||||||||||||||||||||||||||||||||||
| 48 | # linga=>$linga, vachana=>$vachana}); | ||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||
| 50 | # 2008-06-05 Fixed 3351 and 3361 from inaaH to inaH (v 0.06) | ||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||
| 52 | 467 | my ($arg_ref) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 467 | ▶ | confess "Argument naam not passed to vibhakti()" if !defined $arg_ref->{naam}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 55 | 466 | ▶ | confess "Argument linga not passed to vibhakti()" if !defined $arg_ref->{linga}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 56 | 465 | ▶ | confess "Argument vibhakti not passed to vibhakti()" if !defined $arg_ref->{vibhakti}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 57 | 464 | ▶ | confess "Argument vachana not passed to vibhakti()" if !defined $arg_ref->{vachana}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | my ( $noun, $vibhakti, $linga, $vachana ) = | ||||||||||||||||||||||||||||||||||||||||||
| 60 | ( $arg_ref -> {naam}, $arg_ref -> {vibhakti}, $arg_ref -> {linga}, | ||||||||||||||||||||||||||||||||||||||||||
| 61 | 463 | $arg_ref -> {vachana}); | |||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | # The last character of noun is chopped to be aakaar | ||||||||||||||||||||||||||||||||||||||||||
| 64 | # (what happens when halant nouns are included?) | ||||||||||||||||||||||||||||||||||||||||||
| 65 | 463 | $noun = sandhi($noun); | |||||||||||||||||||||||||||||||||||||||||
| 66 | 463 | my $aakaar = chop($noun); | |||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||
| 68 | 463 | $vibhakti = sandhi($vibhakti); | |||||||||||||||||||||||||||||||||||||||||
| 69 | 463 | $linga = sandhi($linga); | |||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||
| 71 | 463 | my %aakaar = qw(0 0 a 1 A 2 i 3 I 4 u 5 U 6 R 7); | |||||||||||||||||||||||||||||||||||||||||
| 72 | 463 | my %linga = qw(puM 1 strI 2 napuMsaka 3 1 1 2 2 3 3); | |||||||||||||||||||||||||||||||||||||||||
| 73 | 463 | my %vachana = qw(ekavachana 1 dvivachana 2 bahuvachana 3 1 1 2 2 3 3); | |||||||||||||||||||||||||||||||||||||||||
| 74 | 463 | my %vibhakti = qw#prathamA 1 dvitIyA 2 tRtIyA 3 chaturthI 4 paJchamI 5 | |||||||||||||||||||||||||||||||||||||||||
| 75 | ShaShThI 6 saptamI 7 sambodhana 8 | ||||||||||||||||||||||||||||||||||||||||||
| 76 | 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8#; | ||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||
| 78 | confess "Unsupported noun supplied to vibhakti(): $noun$aakaar ending in $aakaar" | ||||||||||||||||||||||||||||||||||||||||||
| 79 | 463 | ▶ | if !defined $aakaar{$aakaar}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 80 | confess "Invalid linga $linga supplied to vibhakti()" | ||||||||||||||||||||||||||||||||||||||||||
| 81 | 462 | ▶ | if !defined $linga{$linga}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 82 | confess "Invalid vibhakti $vibhakti supplied to vibhakti()" | ||||||||||||||||||||||||||||||||||||||||||
| 83 | 461 | ▶ | if !defined $vibhakti{$vibhakti}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 84 | confess "Invalid vachana $vachana supplied to vibhakti()" | ||||||||||||||||||||||||||||||||||||||||||
| 85 | 460 | ▶ | if !defined $vachana{$vachana}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||
| 87 | # coef for swarAnt nouns range from 1111 to 7373 | ||||||||||||||||||||||||||||||||||||||||||
| 88 | # with 7 sets of 72 coefs posible (not all taken) | ||||||||||||||||||||||||||||||||||||||||||
| 89 | my $coef = | ||||||||||||||||||||||||||||||||||||||||||
| 90 | $aakaar{$aakaar} * 1000 + | ||||||||||||||||||||||||||||||||||||||||||
| 91 | $linga{$linga} * 100 + | ||||||||||||||||||||||||||||||||||||||||||
| 92 | $vibhakti{$vibhakti} * 10 + | ||||||||||||||||||||||||||||||||||||||||||
| 93 | 459 | $vachana{$vachana}; | |||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||
| 95 | #### 1000 through 7000 aakaar. 1=a 2=A 3=i 4=I 5=u 6=U 7=Ru | ||||||||||||||||||||||||||||||||||||||||||
| 96 | ##### 100 puM 200 strI 300 na | ||||||||||||||||||||||||||||||||||||||||||
| 97 | ###### 10 through 80 8 vibhakti (8th being sambodhan) | ||||||||||||||||||||||||||||||||||||||||||
| 98 | ####### 1 through 3 eka, dwi, bahuvachan | ||||||||||||||||||||||||||||||||||||||||||
| 99 | ## possibilities for nouns are in the following series: | ||||||||||||||||||||||||||||||||||||||||||
| 100 | # Masculine:1100, 3100, 5100, 7100 # examples of 2100? | ||||||||||||||||||||||||||||||||||||||||||
| 101 | # Feminine: 2200, 3200, 4200, 5200, 6200, 7200 | ||||||||||||||||||||||||||||||||||||||||||
| 102 | # Neutar: 1300, 3300, 5300, 7300 | ||||||||||||||||||||||||||||||||||||||||||
| 103 | # 2100, 4100 exist, but I do not know the examples. | ||||||||||||||||||||||||||||||||||||||||||
| 104 | # not sure of 6100, 6300 | ||||||||||||||||||||||||||||||||||||||||||
| 105 | # 1200, 2300, 4300 do not exist | ||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||
| 107 | # These are the noun suffixes | ||||||||||||||||||||||||||||||||||||||||||
| 108 | 459 | my %ending = qw( | |||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||
| 110 | 1111 aH 1112 au 1113 AH | ||||||||||||||||||||||||||||||||||||||||||
| 111 | 1121 am 1122 au 1123 An | ||||||||||||||||||||||||||||||||||||||||||
| 112 | 1131 ena 1132 Abhyaam 1133 aiH | ||||||||||||||||||||||||||||||||||||||||||
| 113 | 1141 Aya 1142 Abhyaam 1143 ebhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 114 | 1151 At 1152 Abhyaam 1153 ebhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 115 | 1161 asya 1162 ayoH 1163 Anaam | ||||||||||||||||||||||||||||||||||||||||||
| 116 | 1171 e 1172 ayoH 1173 eSu | ||||||||||||||||||||||||||||||||||||||||||
| 117 | 1181 a 1182 au 1183 AH | ||||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||
| 119 | 2111 AH 2112 au 2113 AH | ||||||||||||||||||||||||||||||||||||||||||
| 120 | 2121 Am 2122 au 2123 aH | ||||||||||||||||||||||||||||||||||||||||||
| 121 | 2131 A 2132 Abhyaam 2133 AbhiH | ||||||||||||||||||||||||||||||||||||||||||
| 122 | 2141 e 2142 Abhyaam 2143 AbhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 123 | 2151 aH 2152 Abhyaam 2153 AbhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 124 | 2161 aH 2162 oH 2163 Am | ||||||||||||||||||||||||||||||||||||||||||
| 125 | 2171 i 2172 oH 2173 Asu | ||||||||||||||||||||||||||||||||||||||||||
| 126 | 2181 Am 2182 au 2183 AH | ||||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||
| 128 | 3111 iH 3112 I 3113 ayaH | ||||||||||||||||||||||||||||||||||||||||||
| 129 | 3121 im 3122 I 3123 In | ||||||||||||||||||||||||||||||||||||||||||
| 130 | 3131 inaa 3132 ibhyaam 3133 ibhiH | ||||||||||||||||||||||||||||||||||||||||||
| 131 | 3141 aye 3142 ibhyaam 3143 ibhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 132 | 3151 eH 3152 ibhyaam 3153 ibhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 133 | 3161 eH 3162 yoH 3163 Inaam | ||||||||||||||||||||||||||||||||||||||||||
| 134 | 3171 au 3172 yoH 3173 iSu | ||||||||||||||||||||||||||||||||||||||||||
| 135 | 3181 e 3182 I 3183 ayaH | ||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||
| 137 | 5111 uH 5112 U 5113 avaH | ||||||||||||||||||||||||||||||||||||||||||
| 138 | 5121 um 5122 U 5123 Un | ||||||||||||||||||||||||||||||||||||||||||
| 139 | 5131 unaa 5132 ubhyaam 5133 ubhiH | ||||||||||||||||||||||||||||||||||||||||||
| 140 | 5141 ave 5142 ubhyaam 5143 ubhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 141 | 5151 oH 5152 ubhyaam 5153 ubhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 142 | 5161 oH 5162 voH 5163 Unaam | ||||||||||||||||||||||||||||||||||||||||||
| 143 | 5171 au 5172 voH 5173 uSu | ||||||||||||||||||||||||||||||||||||||||||
| 144 | 5181 o 5182 U 5183 avaH | ||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||
| 146 | 7111 A 7112 Arau 7113 AraH | ||||||||||||||||||||||||||||||||||||||||||
| 147 | 7121 Aram 7122 Arau 7123 RRn | ||||||||||||||||||||||||||||||||||||||||||
| 148 | 7131 raa 7132 Rbhyaam 7133 RbhiH | ||||||||||||||||||||||||||||||||||||||||||
| 149 | 7141 re 7142 Rbhyaam 7143 RbhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 150 | 7151 uH 7152 Rbhyaam 7153 RbhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 151 | 7161 uH 7162 roH 7163 RRNaam | ||||||||||||||||||||||||||||||||||||||||||
| 152 | 7171 ari 7172 roH 7173 RSu | ||||||||||||||||||||||||||||||||||||||||||
| 153 | 7181 aH|ar 7182 Arau 7183 AraH | ||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||
| 155 | 2211 A 2212 e 2213 AH | ||||||||||||||||||||||||||||||||||||||||||
| 156 | 2221 Am 2222 e 2223 AH | ||||||||||||||||||||||||||||||||||||||||||
| 157 | 2231 ayaa 2232 Abhyaam 2233 AbhiH | ||||||||||||||||||||||||||||||||||||||||||
| 158 | 2241 Ayai 2242 Abhyaam 2243 AbhyaaH | ||||||||||||||||||||||||||||||||||||||||||
| 159 | 2251 AyaaH 2252 Abhyaam 2253 AbhyaaH | ||||||||||||||||||||||||||||||||||||||||||
| 160 | 2261 AyaaH 2262 ayoH 2263 Anaam | ||||||||||||||||||||||||||||||||||||||||||
| 161 | 2271 Ayaam 2272 ayoH 2273 Asu | ||||||||||||||||||||||||||||||||||||||||||
| 162 | 2281 e 2282 e 2283 AH | ||||||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||||||
| 164 | 3211 iH 3212 I 3213 ayaH | ||||||||||||||||||||||||||||||||||||||||||
| 165 | 3221 im 3222 I 3223 IH | ||||||||||||||||||||||||||||||||||||||||||
| 166 | 3231 yaa 3232 ibhyaam 3233 ibhiH | ||||||||||||||||||||||||||||||||||||||||||
| 167 | 3241 yai|aye 3242 ibhyaam 3243 ibhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 168 | 3251 yaaH|eH 3252 ibhyaam 3253 ibhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 169 | 3261 yaaH|eH 3262 yoH 3263 Inaam | ||||||||||||||||||||||||||||||||||||||||||
| 170 | 3271 yaam|au 3272 yoH 3273 iSu | ||||||||||||||||||||||||||||||||||||||||||
| 171 | 3281 e 3282 I 3283 ayaH | ||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||
| 173 | 4211 I 4212 yau 4213 yaH | ||||||||||||||||||||||||||||||||||||||||||
| 174 | 4221 Im 4222 yau 4223 IH | ||||||||||||||||||||||||||||||||||||||||||
| 175 | 4231 yaa 4232 Ibhyaam 4233 IbhiH | ||||||||||||||||||||||||||||||||||||||||||
| 176 | 4241 yai 4242 Ibhyaam 4243 IbhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 177 | 4251 yaaH 4252 Ibhyaam 4253 IbhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 178 | 4261 yaaH 4262 yoH 4263 Inaam | ||||||||||||||||||||||||||||||||||||||||||
| 179 | 4271 yaam 4272 yoH 4273 ISu | ||||||||||||||||||||||||||||||||||||||||||
| 180 | 4281 i 4282 yau 4283 yaH | ||||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||
| 182 | 5211 uH 5212 U 5213 avaH | ||||||||||||||||||||||||||||||||||||||||||
| 183 | 5221 um 5222 U 5223 UH | ||||||||||||||||||||||||||||||||||||||||||
| 184 | 5231 vaa 5232 ubhyaam 5233 ubhiH | ||||||||||||||||||||||||||||||||||||||||||
| 185 | 5241 ave|vai 5242 ubhyaam 5243 ubhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 186 | 5251 oH|vaaH 5252 ubhyaam 5253 ubhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 187 | 5261 oH|vaaH 5262 voH 5263 Unaam | ||||||||||||||||||||||||||||||||||||||||||
| 188 | 5271 au|vaam 5272 voH 5273 uSu | ||||||||||||||||||||||||||||||||||||||||||
| 189 | 5281 o 5282 U 5283 avaH | ||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||
| 191 | 6211 UH 6212 vau 6213 vaH | ||||||||||||||||||||||||||||||||||||||||||
| 192 | 6221 Um 6222 vau 6223 UH | ||||||||||||||||||||||||||||||||||||||||||
| 193 | 6231 vaa 6232 Ubhyaam 6233 UbhiH | ||||||||||||||||||||||||||||||||||||||||||
| 194 | 6241 vai 6242 Ubhyaam 6243 UbhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 195 | 6251 vaaH 6252 Ubhyaam 6253 UbhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 196 | 6261 vaaH 6262 voH 6263 Unaam | ||||||||||||||||||||||||||||||||||||||||||
| 197 | 6271 vaam 6272 voH 6273 USu | ||||||||||||||||||||||||||||||||||||||||||
| 198 | 6281 u 6282 vau 6283 vaH | ||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||
| 200 | 7211 A 7212 arau 7213 araH | ||||||||||||||||||||||||||||||||||||||||||
| 201 | 7221 aram 7222 arau 7223 RRH | ||||||||||||||||||||||||||||||||||||||||||
| 202 | 7231 raa 7232 Rbhyaam 7233 RbhiH | ||||||||||||||||||||||||||||||||||||||||||
| 203 | 7241 re 7242 Rbhyaam 7243 RbhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 204 | 7251 uH 7252 Rbhyaam 7253 RbhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 205 | 7261 uH 7262 roH 7263 RRNaam | ||||||||||||||||||||||||||||||||||||||||||
| 206 | 7271 ari 7272 roH 7273 RSu | ||||||||||||||||||||||||||||||||||||||||||
| 207 | 7281 aH|ar 7282 arau 7283 araH | ||||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||
| 209 | 1311 am 1312 e 1313 Ani | ||||||||||||||||||||||||||||||||||||||||||
| 210 | 1321 am 1322 e 1323 Ani | ||||||||||||||||||||||||||||||||||||||||||
| 211 | 1331 ena 1332 Abhyaam 1333 aiH | ||||||||||||||||||||||||||||||||||||||||||
| 212 | 1341 Aya 1342 Abhyaam 1343 ebhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 213 | 1351 At 1352 Abhyaam 1353 ebhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 214 | 1361 asya 1362 ayoH 1363 Anaam | ||||||||||||||||||||||||||||||||||||||||||
| 215 | 1371 e 1372 ayoH 1373 eSu | ||||||||||||||||||||||||||||||||||||||||||
| 216 | 1381 a 1382 e 1383 Ani | ||||||||||||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||||||||||||
| 218 | 3311 i 3312 inI 3313 Ini | ||||||||||||||||||||||||||||||||||||||||||
| 219 | 3321 i 3322 inI 3323 Ini | ||||||||||||||||||||||||||||||||||||||||||
| 220 | 3331 inaa 3332 ibhyaam 3333 ibhiH | ||||||||||||||||||||||||||||||||||||||||||
| 221 | 3341 ine 3342 ibhyaam 3343 ibhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 222 | 3351 inaH 3352 ibhyaam 3353 ibhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 223 | 3361 inaH 3362 inoH 3363 Inaam | ||||||||||||||||||||||||||||||||||||||||||
| 224 | 3371 ini 3372 inoH 3373 iSu | ||||||||||||||||||||||||||||||||||||||||||
| 225 | 3381 i|e 3382 inI 3383 Ini | ||||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||
| 227 | 5311 u 5312 unI 5313 Uni | ||||||||||||||||||||||||||||||||||||||||||
| 228 | 5321 u 5322 unI 5323 Uni | ||||||||||||||||||||||||||||||||||||||||||
| 229 | 5331 unaa 5332 ubhyaam 5333 ubhiH | ||||||||||||||||||||||||||||||||||||||||||
| 230 | 5341 une 5342 ubhyaam 5343 ubhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 231 | 5351 unaH 5352 ubhyaam 5353 ubhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 232 | 5361 unaH 5362 unoH 5363 Unaam | ||||||||||||||||||||||||||||||||||||||||||
| 233 | 5371 uni 5372 unoH 5373 uSu | ||||||||||||||||||||||||||||||||||||||||||
| 234 | 5381 o|u 5382 unI 5383 Uni | ||||||||||||||||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||||||||||||||||
| 236 | 7311 R 7312 RNI 7313 RRNi | ||||||||||||||||||||||||||||||||||||||||||
| 237 | 7321 R 7322 RNI 7323 RRNi | ||||||||||||||||||||||||||||||||||||||||||
| 238 | 7331 raa|RNA 7332 Rbhyaam 7333 RbhiH | ||||||||||||||||||||||||||||||||||||||||||
| 239 | 7341 re|RNe 7342 Rbhyaam 7343 RbhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 240 | 7351 uH|RNaH 7352 Rbhyaam 7353 RbhyaH | ||||||||||||||||||||||||||||||||||||||||||
| 241 | 7361 uH|RNaH 7362 roH|RNoH 7363 RRNaam | ||||||||||||||||||||||||||||||||||||||||||
| 242 | 7371 ari|RNi 7372 roH|RNoH 7373 RSu | ||||||||||||||||||||||||||||||||||||||||||
| 243 | 7381 aH|R 7382 RNI 7383 RRNi | ||||||||||||||||||||||||||||||||||||||||||
| 244 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||||||||||||||||
| 246 | # Is 3263 above dirgha as stated? ## Yes, it is | ||||||||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||||||||
| 248 | confess "$linga nouns ending in $aakaar not supported" | ||||||||||||||||||||||||||||||||||||||||||
| 249 | 459 | ▶ | if !defined $ending{$coef}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||||||||||||
| 251 | ### This part can cater to irregular nouns | ||||||||||||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||||||||||||
| 253 | # ambA, akkA, allA have a-kaaraant sambodhana | ||||||||||||||||||||||||||||||||||||||||||
| 254 | 458 | ▶ | if($noun eq "amb" or $noun eq "akk" or $noun eq "all"){ | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
$noun eq "amb" or $noun eq "akk" or $noun eq "all"
$noun eq "amb" or $noun eq "akk"
MC/DC100%3/3
$noun eq "amb" or $noun eq "akk" or $noun eq "all"
$noun eq "amb"
$noun eq "akk"
$noun eq "all"
Truth table100%4/4
A or B or C
A= $noun eq "amb"B= $noun eq "akk"C= $noun eq "all"
| |||||||||||||||||||||||||||||||||||||||||||
| 255 | 3 | $ending{2281} = 'a'; | |||||||||||||||||||||||||||||||||||||||||
| 256 | } | ||||||||||||||||||||||||||||||||||||||||||
| 257 | |||||||||||||||||||||||||||||||||||||||||||
| 258 | 458 | my $endcoef = $ending{$coef}; | |||||||||||||||||||||||||||||||||||||||||
| 259 | |||||||||||||||||||||||||||||||||||||||||||
| 260 | # Natva results in converting n to N when an r, R, RR, or S are encountered in | ||||||||||||||||||||||||||||||||||||||||||
| 261 | # the noun, and the only letters between there and end are what are in Natva | ||||||||||||||||||||||||||||||||||||||||||
| 262 | # here (h y v k kh g gh ~N p ph b bh m and a pratyay (aa~N - not implemented) | ||||||||||||||||||||||||||||||||||||||||||
| 263 | # Additionally, n can not be halant | ||||||||||||||||||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||||||||||||||||
| 265 | 458 | my $Natva = "h|y|v|k(h)?|g(h)?|G|p(h)?|b(h)?|m"; | |||||||||||||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||||||||||||
| 267 | # vowel is as defined in split_word | ||||||||||||||||||||||||||||||||||||||||||
| 268 | 458 | my $vowel = "(A|H|I|M|R(R|u)?|U|a(a|i|u)?|i(i)?|e|lR|o(M)?|u(u)?|\\:|\\|(\\|)?)"; | |||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||
| 270 | 458 | my $inflected; | |||||||||||||||||||||||||||||||||||||||||
| 271 | |||||||||||||||||||||||||||||||||||||||||||
| 272 | ### This part can be expanded to include exceptions/options | ||||||||||||||||||||||||||||||||||||||||||
| 273 | |||||||||||||||||||||||||||||||||||||||||||
| 274 | 458 | ▶ | if ($noun =~ m/[rRS][$Natva|$vowel]*$/ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 275 | 120 | $endcoef =~ s/n([a-zA-Z])/N$1/; | |||||||||||||||||||||||||||||||||||||||||
| 276 | } | ||||||||||||||||||||||||||||||||||||||||||
| 277 | 458 | ▶ | if ( $endcoef =~ m/\|/ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 278 | 36 | my @foo = split( /\|/, $endcoef ); | |||||||||||||||||||||||||||||||||||||||||
| 279 | 36 | $inflected = "$noun + $foo[0]"; | |||||||||||||||||||||||||||||||||||||||||
| 280 | 36 | for my $counter ( 1 .. $#foo ) { | |||||||||||||||||||||||||||||||||||||||||
| 281 | 36 | $inflected.= " | $noun + $foo[$counter]"; | |||||||||||||||||||||||||||||||||||||||||
| 282 | } | ||||||||||||||||||||||||||||||||||||||||||
| 283 | } | ||||||||||||||||||||||||||||||||||||||||||
| 284 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 285 | 422 | $inflected = "$noun + $endcoef"; | |||||||||||||||||||||||||||||||||||||||||
| 286 | } | ||||||||||||||||||||||||||||||||||||||||||
| 287 | ## if sambodhan, prepend he | ||||||||||||||||||||||||||||||||||||||||||
| 288 | 458 | ▶ | if ( $coef % 100 > 80 ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 289 | 47 | ▶ | if ( $endcoef =~ m/\|/ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 290 | 5 | $inflected = "he \[ $inflected ]"; | |||||||||||||||||||||||||||||||||||||||||
| 291 | } | ||||||||||||||||||||||||||||||||||||||||||
| 292 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 293 | 42 | $inflected = "he $inflected"; | |||||||||||||||||||||||||||||||||||||||||
| 294 | } | ||||||||||||||||||||||||||||||||||||||||||
| 295 | } | ||||||||||||||||||||||||||||||||||||||||||
| 296 | 458 | return $inflected; | |||||||||||||||||||||||||||||||||||||||||
| 297 | } ## end sub vibhakti | ||||||||||||||||||||||||||||||||||||||||||
| 298 | ############################### | ||||||||||||||||||||||||||||||||||||||||||
| 299 | 23 | ▶ | sub transliterate { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
transliterate: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 300 | |||||||||||||||||||||||||||||||||||||||||||
| 301 | # Takes a string as input. Separate it into words. | ||||||||||||||||||||||||||||||||||||||||||
| 302 | # Splits each word into syllables, and for each syllable appends its | ||||||||||||||||||||||||||||||||||||||||||
| 303 | # unicode to an array that is finally flattened and returned | ||||||||||||||||||||||||||||||||||||||||||
| 304 | |||||||||||||||||||||||||||||||||||||||||||
| 305 | 23 | my ($english) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 306 | 23 | my @transliterated; | |||||||||||||||||||||||||||||||||||||||||
| 307 | 23 | my @x = split( /\s+/, $english ); # splt input string in to words | |||||||||||||||||||||||||||||||||||||||||
| 308 | 23 | for my $x (@x) { # get unicoded syllables for each word | |||||||||||||||||||||||||||||||||||||||||
| 309 | 23 | push( @transliterated, map( match_code($_), split_word($x) ), " " ); | |||||||||||||||||||||||||||||||||||||||||
| 310 | } | ||||||||||||||||||||||||||||||||||||||||||
| 311 | 23 | return join( "", @transliterated ); # flatten the array before returning | |||||||||||||||||||||||||||||||||||||||||
| 312 | } | ||||||||||||||||||||||||||||||||||||||||||
| 313 | ############################### | ||||||||||||||||||||||||||||||||||||||||||
| 314 | 36 | ▶ | sub match_code { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
match_code: called CC=2 SCAR=7.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 315 | 36 | my ($syllable_mcc) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 316 | 36 | my %letter_codes = ( | |||||||||||||||||||||||||||||||||||||||||
| 317 | "~a", "अ", "~aa", "आ", "~A", "आ", | ||||||||||||||||||||||||||||||||||||||||||
| 318 | "~i", "इ", "~ii", "ई", "~uu", "ऊ", | ||||||||||||||||||||||||||||||||||||||||||
| 319 | "ii", "ी", "~I", "ई", "~u", "उ", | ||||||||||||||||||||||||||||||||||||||||||
| 320 | "~U", "ऊ", "~R", "ऋ", "~Ru", "ऋ", | ||||||||||||||||||||||||||||||||||||||||||
| 321 | "~lR", "ऌ", "~RR", "ॠ", "~e", "ए", | ||||||||||||||||||||||||||||||||||||||||||
| 322 | "~ai", "ऐ", "~o", "ओ", "~au", "औ", | ||||||||||||||||||||||||||||||||||||||||||
| 323 | "a", "", "aa", "ा", "A", "ा", | ||||||||||||||||||||||||||||||||||||||||||
| 324 | "i", "ि", "I", "ी", "u", "ु", | ||||||||||||||||||||||||||||||||||||||||||
| 325 | "uu", "ू", "R", "ृ", "lR", "ॢ", | ||||||||||||||||||||||||||||||||||||||||||
| 326 | "e", "े", "ai", "ै", | ||||||||||||||||||||||||||||||||||||||||||
| 327 | "U", "ू", "R", "ृ", "Ru", "ृ", | ||||||||||||||||||||||||||||||||||||||||||
| 328 | "RR", "ॄ", "o", "ो", "au", "ौ", | ||||||||||||||||||||||||||||||||||||||||||
| 329 | "k", "क", "kh", "ख", "g", "ग", | ||||||||||||||||||||||||||||||||||||||||||
| 330 | "gh", "घ", "G", "ङ", "c", "च", | ||||||||||||||||||||||||||||||||||||||||||
| 331 | "ch", "च", "C", "छ", "Ch", "छ", | ||||||||||||||||||||||||||||||||||||||||||
| 332 | "j", "ज", "jh", "झ", "J", "ञ", | ||||||||||||||||||||||||||||||||||||||||||
| 333 | "T", "ट", "Th", "ठ", "D", "ड", | ||||||||||||||||||||||||||||||||||||||||||
| 334 | "Dh", "ढ", "N", "ण", "t", "त", | ||||||||||||||||||||||||||||||||||||||||||
| 335 | "th", "थ", "d", "द", "dh", "ध", | ||||||||||||||||||||||||||||||||||||||||||
| 336 | "n", "न", "p", "प", "ph", "फ", | ||||||||||||||||||||||||||||||||||||||||||
| 337 | "b", "ब", "bh", "भ", "m", "म", | ||||||||||||||||||||||||||||||||||||||||||
| 338 | "y", "य", "r", "र", "l", "ल", | ||||||||||||||||||||||||||||||||||||||||||
| 339 | "L", "ळ", | ||||||||||||||||||||||||||||||||||||||||||
| 340 | "v", "व", "z", "श", "sh", "श", | ||||||||||||||||||||||||||||||||||||||||||
| 341 | "S", "ष", "Sh", "ष", "s", "स", | ||||||||||||||||||||||||||||||||||||||||||
| 342 | "h", "ह", "H", "ः", ":", "ः", | ||||||||||||||||||||||||||||||||||||||||||
| 343 | "M", "ं", "|", "।", "||", "॥", | ||||||||||||||||||||||||||||||||||||||||||
| 344 | "oM", "ॐ", "~H", "ः", "~:", "ः", | ||||||||||||||||||||||||||||||||||||||||||
| 345 | "~M", "ं", "~|", "।", "~||", "॥", | ||||||||||||||||||||||||||||||||||||||||||
| 346 | "\$", "ऽ", "^", "॑", "_", "॒", | ||||||||||||||||||||||||||||||||||||||||||
| 347 | "`", "॓", "'", "॔", "\@", "॰", | ||||||||||||||||||||||||||||||||||||||||||
| 348 | "~oM", "ॐ", "*", "्", "CB", "ँ", | ||||||||||||||||||||||||||||||||||||||||||
| 349 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 350 | # RR 2400 lRR 2401 _lR 2402 _lRR 2403 chandra-bindu 2305 | ||||||||||||||||||||||||||||||||||||||||||
| 351 | 36 | ▶ | if ( defined $letter_codes{$syllable_mcc} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 352 | 36 | return $letter_codes{$syllable_mcc}; | |||||||||||||||||||||||||||||||||||||||||
| 353 | } | ||||||||||||||||||||||||||||||||||||||||||
| 354 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 355 | 0 | return $syllable_mcc; | |||||||||||||||||||||||||||||||||||||||||
| 356 | } | ||||||||||||||||||||||||||||||||||||||||||
| 357 | } ## end sub match_code | ||||||||||||||||||||||||||||||||||||||||||
| 358 | ######################################## | ||||||||||||||||||||||||||||||||||||||||||
| 359 | 23 | ▶ | sub split_word { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
split_word: called CC=10 SCAR=23.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 360 | 23 | my ($word) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 361 | # vowels is copied as is in vibhakti | ||||||||||||||||||||||||||||||||||||||||||
| 362 | 23 | my $vowels = "(A|H|I|M|R(R|u)?|U|a(a|i|u)?|i(i)?|e|lR|o(M)?|u(u)?|\\:|\\|(\\|)?)"; | |||||||||||||||||||||||||||||||||||||||||
| 363 | 23 | my $consonants = | |||||||||||||||||||||||||||||||||||||||||
| 364 | "(C(h|B)?|D(h)?|G|J|N|S(h)?|T(h)?|b(h)?|c(h)?|d(h)?|g(h)?|h|j(h)?|k(h)?|l|m|n|p(h)?|r|s(h)?|t(h)?|v|y|z|L)"; | ||||||||||||||||||||||||||||||||||||||||||
| 365 | 23 | my @syllables; | |||||||||||||||||||||||||||||||||||||||||
| 366 | 23 | my $vowel_start_p = 1; | |||||||||||||||||||||||||||||||||||||||||
| 367 | 23 | my $matched; | |||||||||||||||||||||||||||||||||||||||||
| 368 | my $index; | ||||||||||||||||||||||||||||||||||||||||||
| 369 | 23 | ▶ | while ($word) { # begin out | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 370 | 34 | ▶ | unless ( $word =~ m/$vowels/ ) { $index = length($word); } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 371 | 32 | else { $index = length($`); } | |||||||||||||||||||||||||||||||||||||||||
| 372 | 34 | ▶ | if ( $index == 0 ) { # begin 3A | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 373 | 21 | $matched = $1; | |||||||||||||||||||||||||||||||||||||||||
| 374 | 21 | ▶ | if ($vowel_start_p) { # begin 0A | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 375 | 10 | push( @syllables, "~$matched" ); | |||||||||||||||||||||||||||||||||||||||||
| 376 | } # end 0A | ||||||||||||||||||||||||||||||||||||||||||
| 377 | else { # begin 0B | ||||||||||||||||||||||||||||||||||||||||||
| 378 | 11 | push( @syllables, $matched ); | |||||||||||||||||||||||||||||||||||||||||
| 379 | } # end 0B | ||||||||||||||||||||||||||||||||||||||||||
| 380 | 21 | $vowel_start_p = 1; | |||||||||||||||||||||||||||||||||||||||||
| 381 | 21 | $word = substr( $word, length($matched) ); | |||||||||||||||||||||||||||||||||||||||||
| 382 | } # end 3A | ||||||||||||||||||||||||||||||||||||||||||
| 383 | else { # begin 3B | ||||||||||||||||||||||||||||||||||||||||||
| 384 | 0 | ▶ | unless ( $word =~ m/$consonants/ ) { $index = length($word); } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 385 | 13 | else { $index = length($`); } | |||||||||||||||||||||||||||||||||||||||||
| 386 | 13 | ▶ | if ( $index == 0 ) { # begin 2A | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 387 | 13 | $matched = $1; | |||||||||||||||||||||||||||||||||||||||||
| 388 | 13 | push( @syllables, $matched ); | |||||||||||||||||||||||||||||||||||||||||
| 389 | 13 | $vowel_start_p = 0; | |||||||||||||||||||||||||||||||||||||||||
| 390 | 13 | $word = substr( $word, length($matched) ); | |||||||||||||||||||||||||||||||||||||||||
| 391 | 13 | ▶ | unless ( $word =~ m/$vowels/ ) { $index = length($word); } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 392 | 11 | else { $index = length($`); } | |||||||||||||||||||||||||||||||||||||||||
| 393 | 13 | ▶ | if ( $index or length($word) == 0 ) { # begin 1A | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$index or length $word == 0
MC/DC50%1/2
$index or length $word == 0
$index
length $word == 0
Truth table66%2/3
A or B
A= $indexB= length $word == 0
| |||||||||||||||||||||||||||||||||||||||||||
| 394 | 2 | push( @syllables, "*" ); | |||||||||||||||||||||||||||||||||||||||||
| 395 | } # end 1A | ||||||||||||||||||||||||||||||||||||||||||
| 396 | else { # begin 1B | ||||||||||||||||||||||||||||||||||||||||||
| 397 | ; | ||||||||||||||||||||||||||||||||||||||||||
| 398 | } # end 1B | ||||||||||||||||||||||||||||||||||||||||||
| 399 | } # end 2A | ||||||||||||||||||||||||||||||||||||||||||
| 400 | else { # begin 2B | ||||||||||||||||||||||||||||||||||||||||||
| 401 | 0 | push( @syllables, substr( $word, 0, 1 ) ); | |||||||||||||||||||||||||||||||||||||||||
| 402 | 0 | $word = substr( $word, 1 ); | |||||||||||||||||||||||||||||||||||||||||
| 403 | } # end 2B | ||||||||||||||||||||||||||||||||||||||||||
| 404 | } # end 3B | ||||||||||||||||||||||||||||||||||||||||||
| 405 | } # end out | ||||||||||||||||||||||||||||||||||||||||||
| 406 | 23 | return @syllables; | |||||||||||||||||||||||||||||||||||||||||
| 407 | } ## end sub split_word | ||||||||||||||||||||||||||||||||||||||||||
| 408 | ########################### | ||||||||||||||||||||||||||||||||||||||||||
| 409 | 10 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 410 | __END__ | ||||||||||||||||||||||||||||||||||||||||||