data/word%.json: data/word%.inc.pl
$(call cmdsave,perl -MJSON=encode_json -E "print encode_json(do \$$ARGV[0])" ./$<)
data/%.json: %.inc.pl
- $(call cmdsave,perl -MJSON=encode_json -E "print encode_json([ do \$$ARGV[0] ])" ./$<)
+ $(call cmdsave,perl -MJSON -E "print JSON->new->utf8->canonical->encode(do \$$ARGV[0])" ./$<)
data/wordpairs.inc.pl: data/wordlist.version.txt
@perl -I. -MShiar_Sheet::DB -MData::Dump=pp -E 'say pp(Shiar_Sheet::DB->connect->select("word w JOIN word a ON w.id=a.ref" => "w.id, a.id", {"a.lang"=>undef})->map or exit 1)' >$@
and <a href="/chars/abc">font comparison</a>.</p>
<:
-use List::Util qw( pairs );
-
-my @table = Data('writing-latn');
+my $table = Data('writing-latn');
{
say '<div>';
say '<style>';
- for my $row (pairs @table) {
- my ($id, $info) = @{$row};
+ while (my ($id, $info) = each %$table) {
+ ref $info eq 'HASH' or next;
my $style = $info->{style} or next;
ref $style or $style = [$style];
say "\t", !/^@/ && "#$id ", $_ for @{$style};
}
say "</style>\n";
+}
- my %VOWELCOLS = (map { ($_ => 1) } 0, 4, 8, 14, 20, 24);
- say '<table class="glyphs">';
- say '<thead><tr><th># <small>ASCII − 64</small>';
- print '<td>', $_ for 1 .. 26;
- say '</thead>';
+my %VOWELCOLS = (map { ($_ => 1) } 0, 4, 8, 14, 20, 24);
+say '<table class="glyphs">';
+say '<thead>';
+printtr('order');
+say '</thead>';
+printtr('default');
+say "</table></div>";
- for my $row (pairs @table) {
- my ($id, $info) = @{$row};
+sub printtr {
+ for my $id (@_) {
+ my $info = $table->{$id};
+
+ if (ref $info eq 'ARRAY') {
+ printtr(@{$info});
+ next;
+ }
printf '<tr id="%s">', $id;
my $th = 'th';
say;
}
}
- say "</table></div>";
}
:>
);
}
-(
++{
+default => [qw( written sign digital touch tactile sound games semaphore barcode personal )],
+written => [qw( uppercase lowercase suetterlin roman )],
+digital => [qw( stroke ita2 )],
+stroke => [qw( graffiti unistrokes edgewrite )],
+touch => [qw( moon braille )],
+sign => ['sutton'],
+sound => [qw( morse tap shorttap )],
+games => [qw( domino tetromino cards )],
+semaphore => [qw( maritime flag chappe prussian )],
+barcode => [qw( rm4scc code39 code93 code128 )],
+personal => [qw( rgbmap cmymap dni pigpen nyctographs chromacons )],
+
+order => {
+ name => '#',
+ list => [1 .. 26],
+},
uppercase => {
list => [qw{ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z }],
},
}
],
},
-);
+};