keyboard: compare combining accents
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 18 Jun 2017 13:18:16 +0000 (15:18 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 19 Feb 2018 22:46:18 +0000 (23:46 +0100)
keyboard.plp

index 3a8f35f..cd75090 100644 (file)
@@ -21,7 +21,7 @@ my $usint = [
        [qw(Á B ¢ Ð É F G H Í J Œ Ø µ Ñ Ó Ö Ä ® § Þ Ú V Å X Ü Æ)],
        [qw(á b © ð é f g h í j œ ø µ ñ ó ö ä ® ß þ ú v å x ü æ)],
        [qw(Å ı Ç ð ´ ̉ ˝ ̣ ˆ ½  Þ ¾ ˜ Ø ∏ Œ ‰ / ˇ ¨ ◊ „ ˛ ¼ ¸)],
-       [qw(å ∫ ç ∂ ´ ƒ © ˙ ^ ∆ ° ¬ µ ~ ø π œ ® ß † ¨ √ ∑ ≈ ¥ Ω)],
+       [qw(å ∫ ç ∂ ́ ƒ © ˙ ̂ ∆ ° ¬ µ ̃ ø π œ ® ß † ̈ √ ∑ ≈ ¥ Ω)],
 ];
 
 my $keys = Shiar_Sheet::Keyboard->new({
@@ -32,8 +32,9 @@ my $keys = Shiar_Sheet::Keyboard->new({
                                my @row = map { $usint->[$_]->[$c] } 0 .. 2;
                                my $class = (
                                          !defined $row[2] || $row[0] eq $row[2] ? 1 # identical
-                                       : NFKD($row[2]) =~ $row[0] ? 2 # equivalent
-                                       : $row[2] =~ /^\p{Latin}/ ? 3 # latin
+                                       : NFKD($row[2]) =~ $row[0] ? 2 # decomposed equivalent
+                                       : $row[2] =~ /^\p{Latin}/ ? 3 # latin script
+                                       : $row[2] =~ /^\p{Mn}/ ? 5 # combining accent
                                        : 4
                                );
                                $row[0] => "g$class"
@@ -50,6 +51,7 @@ my $keys = Shiar_Sheet::Keyboard->new({
                g2 => ['accented'],
                g3 => ['latin'],
                g4 => ['other'],
+               g5 => ['combining'],
        },
 });
 $keys->map($get{map}) or undef $get{map};