keyboard: omit legends of unused diacritic classes
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 3 Dec 2023 17:40:38 +0000 (18:40 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 19 Dec 2023 03:03:44 +0000 (04:03 +0100)
keyboard.eng.inc.pl

index 1f372e32c2cf1c8e253e743a3f80dabc1d36247c..378acdc6dee87d5420416181a5f4d45e951033e1 100644 (file)
@@ -1,6 +1,7 @@
 use Unicode::Normalize qw( NFKD );
 use Text::Unidecode qw( unidecode );
 
+my %g; # present group classes
 {
        rows => [0, 1],
        def => {
@@ -17,6 +18,7 @@ use Text::Unidecode qw( unidecode );
                                        : $v =~ /^\p{Latin}/ ? 5 # latin script
                                        : 6
                                );
+                               $g{$class} = 1;
                                $_ => "g$class"
                        } keys %rows
                },
@@ -29,7 +31,9 @@ use Text::Unidecode qw( unidecode );
                g5 => ['latin', "a different (accented) latin letter"],
                g6 => ['symbol', "other character not directly deducible from key"],
                g7 => ['punctuation', "(punctuation) mark"],
+                       !$g{9} ? () : (
                g8 => ['mark', "modifier letter or mark (spacing diacritic)"],
                g9 => ['combining', "diacritical mark to be combined with a following character"],
+                       ),
        },
 }