#!/usr/bin/perl -w
binmode
(STDOUT,
":utf8"
);
main:
{
$_
=
"ሀለሐመሠረሰ"
;
print
"Staring with $_...\n\n"
;
print
"1) Set all [=ሀ=] to the ራብዕ form:\n"
;
print
" s/([=ሀ=])/setForm(\$1,\$ራብዕ)/eg;\n"
;
s/([=ሀ=])/setForm($1,$ራብዕ)/eg;
print
" => $_\n\n"
;
print
"2) Set all [=ሰ=] to the ሳብዕ form:\n"
;
print
" s/([=ሰ=])/setForm(\$1,\$ሳብዕ)/eg;)\n"
;
s/([=ሰ=])/setForm($1,$ሳብዕ)/eg;
print
" => $_\n\n"
;
print
"3) Set all ግዕዝ forms to the ኃምስ form:\n"
;
print
" s/([:ግዕዝ:])/setForm(\$1,\$ኃምስ)/eg;\n"
;
s/([:ግዕዝ:])/setForm($1,$ኃምስ)/eg;
print
" => $_\n\n"
;
print
" Note: This last substitution was equivalent to:\n"
;
print
" s/([#1#])/setForm(\$1,\$ኃምስ)/eg;\n\n"
;
print
"4) Substitute a [#ጸ#] for a [#ሰ#] in the form found for the [#ሰ#]:\n"
;
print
" s/([#ሰ#])/subForm('ጸ',\$1)/eg;\n"
;
s/([
print
" => $_\n\n"
;
print
"5) Report all forms:\n"
;
print
" s/(.)/print \" \$1 is of form \", getForm(\$1),\"\\n\"; \$1/eg\n"
;
s/(.)/
print
" $1 is of form "
, getForm($1),
"\n"
; $1/eg;
print
"\n"
;
print
"6) Back to where we started (except for the ጸ of course):\n"
;
print
" s/(.)/setForm(\$1,\$ግዕዝ)/eg;\n"
;
s/(.)/setForm($1,$ግዕዝ)/eg;
print
" => $_\n\n"
;
print
"7) Format አበገደ as አቡጊዳ:\n"
;
print
" print formatForms ( \"%1%2%3%4\", \"አበገደ\" );\n"
;
print
" => "
, formatForms (
"%1%2%3%4"
,
"አበገደ"
),
"\n"
;
}