From d9e583b78f0dc37673be599f60c25c788244fa5c Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Wed, 19 Apr 2017 01:31:33 +0200 Subject: [PATCH] digits: store row data as hash reference --- digits.plp | 6 +++--- writing-digits.inc.pl | 14 ++++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/digits.plp b/digits.plp index 6666b8f..2bef8f3 100644 --- a/digits.plp +++ b/digits.plp @@ -40,20 +40,20 @@ unless (exists $get{v}) { my $scriptname = do 'writing-script.inc.pl'; $_ = qq{$_} 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 '
', $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 '
'; } -printtable(@{ $table{$_} }) for @{ $table{default} }; +printtable(@{ $table->{$_} }) for @{ $table->{default} }; :> diff --git a/writing-digits.inc.pl b/writing-digits.inc.pl index 5418be5..ff6860f 100644 --- a/writing-digits.inc.pl +++ b/writing-digits.inc.pl @@ -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 }], }, -); + +}; -- 2.30.0