keyboard: fix combining accent distinction
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 4 Mar 2018 21:32:25 +0000 (22:32 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 16 Mar 2018 20:45:20 +0000 (21:45 +0100)
Regression in commit v1.10-74-g8626278605 (2018-03-05)
[keyboard: match transliterated letters].

keyboard.plp

index b23e2f2db3e37135bde781948dc28f73c30a8fec..2ecfa8b9fa0c00bfe32091cd7862e03cc3dc221e 100644 (file)
@@ -45,10 +45,10 @@ my $keys = Shiar_Sheet::Keyboard->new({
                                my @row = @{$_};
                                my $class = (
                                          !defined $row[2] || $row[0] eq $row[2] ? 1 # identical
+                                       : $row[2] =~ /\A\p{Mn}+\z/ ? 8 # combining accent
                                        : NFKD($row[2]) =~ $row[0] ? 2 # decomposed equivalent
                                        : $row[2] =~ /^\p{Latin}/ ? 4 # latin script
                                        : unidecode($row[2]) =~ /^\W*\Q$row[0]/ ? 5 # transliterated
-                                       : $row[2] =~ /^\p{Mn}/ ? 8 # combining accent
                                        : 7
                                );
                                $row[0] => "g$class"
@@ -64,6 +64,7 @@ my $keys = Shiar_Sheet::Keyboard->new({
                g1 => ['unaltered'],
                g2 => ['accented'],
                g4 => ['latin'],
+               g5 => ['similar'],
                g7 => ['other'],
                g8 => ['combining'],
        },