use open OUT => ':utf8', ':std';
use Data::Dump 'pp';
-our $VERSION = '1.00';
+our $VERSION = '1.01';
my %info = (
# prepare presentational string for some control(lish) entries
"\xAD" => {string => '-'},
"\x{200E}" => {string => '→'},
"\x{200F}" => {string => '←'},
- "\x{200B}" => {string => '␣'},
+ "\x{200B}" => {string => '␣'}, # nbsp: ~ in TeX
"\x{200C}" => {string => '|'}, # ISO-9995-7-081 lookalike (alt: ∣ ⊺ ⟙)
"\x{200D}" => {string => '⁀'}, # join (alt: ∤ |ͯ ⨝)
);
my %diinc = (
'data/digraphs-rfc.inc.pl' => 'u-di',
- 'data/digraphs-shiar.inc.pl' => 'u-prop Xz',
+ 'data/digraphs-shiar.inc.pl' => 'u-prop ex',
+ 'data/digraphs-vim.inc.pl' => 'u-prop',
);
-for (keys %diinc) {
+for (sort keys %diinc) {
-e $_ or next;
my $di = do $_ or die "Error reading digraphs file $_: ", $@ || $!;
- while (my ($mnem, $cp) = each %$di) {
+ for my $mnem (sort keys %{$di}) {
+ my $cp = $di->{$mnem};
length $mnem == 2 or next; # limit to digraphs
my $class = $diinc{$_};
- $info{chr $cp}->{di} //= $mnem;
- $info{chr $cp}->{class}->{$class}++;
+ $info{$cp}->{di} //= $mnem;
+ $info{$cp}->{class}->{$class}++;
}
}
$info->{$_} = $info{$chr}->{$_} for keys %{ $info{$chr} };
+ # official digraphs either lose vim flag or gain experimental
+ delete $info->{class}->{'u-prop'} or $info->{class}->{ex}++
+ if $info->{class}->{'u-di'};
+
# categorise by unicode types and writing script
$info->{class}->{$_}++ for $info->{category};
$info->{class}->{$_}++ for $info->{script} || ();