digits: store row data as hash reference
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 18 Apr 2017 23:31:33 +0000 (01:31 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 25 May 2017 20:10:22 +0000 (22:10 +0200)
digits.plp
writing-digits.inc.pl

index 6666b8f3f52aab0d933b35bfaae54a5da0cf85f7..2bef8f3cfe2ba7db7375700a19fe671877fe1895 100644 (file)
@@ -40,20 +40,20 @@ unless (exists $get{v}) {
 my $scriptname = do 'writing-script.inc.pl';
 $_ = qq{<a href="/latin">$_</a>} for $scriptname->{latn} || ();
 
-my %table = do "writing-digits.inc.pl";
+my $table = do "writing-digits.inc.pl";
 die "Table data not found: $_\n" for $@ || $! || ();
 
 sub printtable {
        say '<div class=section>', $glyphs->tabletag;
        for my $id (@_) {
-               my $info = $table{$id};
+               my $info = $table->{$id};
                my $title = $info->{title} // $scriptname->{$id} || $id;
                print $glyphs->row([ ".>$title", @{$info->{list}} ]);
        }
        say '</table></div>';
 }
 
-printtable(@{ $table{$_} }) for @{ $table{default} };
+printtable(@{ $table->{$_} }) for @{ $table->{default} };
 
 :></div>
 
index 5418be52dc941990bf66e02cff32c9853b4f59d8..ff6860f20852a325e73a0e03bf1be43abc183e8a 100644 (file)
@@ -1,12 +1,14 @@
 use utf8;
-(
++{
+
 default  => [qw( brahmi western sign eastern )],
+
 eastern  => [qw( hant hans suzhou rod )],
+western  => [qw( arabindi arabpers ethi copt latn latnlat xsux maya teng tlh osma brai )],
 brahmi   => [qw(
        khmr java bali sund talu lana lanahora laoo mlym taml cham kali mymr cakm
        thai knda telu tibt lepc beng olck saur orya guru gujr deva brahnumb brah
 )],
-western  => [qw( arabindi arabpers ethi copt latn latnlat xsux maya teng tlh osma brai )],
 sign     => [qw( suttus suttbe suttnl )],
 
 hant     => {list => [qw{ >- 壹 貳 參 肆 伍 陸 柒 捌 玖 零 }]},
@@ -14,9 +16,10 @@ hans     => {list => [qw{ 〇 一 二 三 四 五 六 七 八 九 十 }]},
 suzhou   => {list => [qw{ >- 〡 〢 〣 〤 〥 〦 〧 〨 〩 〸 }], title => 'Suzhou'},
 rod      => {list => [qw{ 〇 𝍩 𝍪 𝍫 𝍬 𝍭 𝍮 𝍯 𝍰 𝍱 𝍠 }]},
 ethi     => {list => [qw{>- ፩ ፪ ፫ ፬ ፭ ፮ ፯ ፰ ፱ ፲ }]},
-khmr     => {list => [qw{ ០ ១ ២ ៣ ៤ ៥ ៦ ៧ ៨ ៩ }]},
 arabindi => {list => [qw{ ٠ ١ ٢ ٣ ٤ ٥ ٦ ٧ ٨ ٩ }], title => 'Arabic (Eastern)'},
 arabpers => {list => [qw{ ۰ ۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹ }], title => 'Arabic (Persian)'},
+
+khmr     => {list => [qw{ ០ ១ ២ ៣ ៤ ៥ ៦ ៧ ៨ ៩ }]},
 java     => {list => [qw{ ꧐ ꧑ ꧒ ꧓ ꧔ ꧕ ꧖ ꧗ ꧘ ꧙ }]},
 bali     => {list => [qw{ ᭐ ᭑ ᭒ ᭓ ᭔ ᭕ ᭖ ᭗ ᭘ ᭙ }]},
 sund     => {list => [qw{ ᮰ ᮱ ᮲ ᮳ ᮴ ᮵ ᮶ ᮷ ᮸ ᮹ }]},
@@ -44,6 +47,7 @@ gujr     => {list => [qw{ ૦ ૧ ૨ ૩ ૪ ૫ ૬ ૭ ૮ ૯ }]},
 deva     => {list => [qw{ ० १ २ ३ ४ ५ ६ ७ ८ ९ }]},
 brahnumb => {list => [qw{>- 𑁒 𑁓 𑁔 𑁕 𑁖 𑁗 𑁘 𑁙 𑁚 𑁛 }], title => 'Brahmi numbers'},
 brah     => {list => [qw{ 𑁦 𑁧 𑁨 𑁩 𑁪 𑁫 𑁬 𑁭 𑁮 𑁯 }], title => 'Brahmi digits'},
+
 copt     => {list => [qw{>- 𐋡 𐋢 𐋣 𐋤 𐋥 𐋦 𐋧 𐋨 𐋩 𐋪 }]},
 latn     => {list => [qw{ 0 1 2 3 4 5 6 7 8 9 }], title => 'Arabic (Western)'},
 latnlat  => {list => [qw{>- Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ }], title => 'Roman'},
@@ -53,6 +57,7 @@ teng     => {list => [qw{            }]},
 tlh      => {list => [qw{            }]},
 osma     => {list => [qw{ 𐒠 𐒡 𐒢 𐒣 𐒤 𐒥 𐒦 𐒧 𐒨 𐒩 }]},
 brai     => {list => [qw{ ⠚ ⠁ ⠃ ⠉ ⠙ ⠑ ⠋ ⠛ ⠓ ⠊ }], title => 'Braille_[⠼+]'},
+
 suttbe => {
        title => 'VGT',
        list => [map { pack 'W*', map { hex "1D$_" } unpack '(A3)*' } qw{
@@ -74,4 +79,5 @@ suttus => {
                887a9c 8A5a9c 8BBa9c 8CEa9c 9A58F5aa2
        }],
 },
-);
+
+};