git.shiar.nl
/
sheet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0ecd498
)
keyboard: match transliterated letters
author
Mischa POSLAWSKY
<perl@shiar.org>
Wed, 21 Feb 2018 08:59:34 +0000
(09:59 +0100)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Mon, 5 Mar 2018 22:51:17 +0000
(23:51 +0100)
keyboard.plp
patch
|
blob
|
history
diff --git
a/keyboard.plp
b/keyboard.plp
index 1ad932462261c95f2360079d18be299e9cba822a..2fe9c073bf656fc2db61df1a262b468d05343b56 100644
(file)
--- a/
keyboard.plp
+++ b/
keyboard.plp
@@
-15,6
+15,7
@@
Html({
<:
use Shiar_Sheet::Keyboard 2.07;
use Unicode::Normalize qw( NFKD );
<:
use Shiar_Sheet::Keyboard 2.07;
use Unicode::Normalize qw( NFKD );
+use Text::Unidecode qw( unidecode );
my @usintrows = (
[ 'a' .. 'z'],
my @usintrows = (
[ 'a' .. 'z'],
@@
-38,9
+39,10
@@
my $keys = Shiar_Sheet::Keyboard->new({
my $class = (
!defined $row[2] || $row[0] eq $row[2] ? 1 # identical
: NFKD($row[2]) =~ $row[0] ? 2 # decomposed equivalent
my $class = (
!defined $row[2] || $row[0] eq $row[2] ? 1 # identical
: NFKD($row[2]) =~ $row[0] ? 2 # decomposed equivalent
- : $row[2] =~ /^\p{Latin}/ ? 3 # latin script
- : $row[2] =~ /^\p{Mn}/ ? 5 # combining accent
- : 4
+ : $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"
} @usint
);
$row[0] => "g$class"
} @usint
@@
-54,9
+56,9
@@
my $keys = Shiar_Sheet::Keyboard->new({
flag => {
g1 => ['unaltered'],
g2 => ['accented'],
flag => {
g1 => ['unaltered'],
g2 => ['accented'],
- g
3
=> ['latin'],
- g
4
=> ['other'],
- g
5
=> ['combining'],
+ g
4
=> ['latin'],
+ g
7
=> ['other'],
+ g
8
=> ['combining'],
},
});
$keys->map($get{map}) or undef $get{map};
},
});
$keys->map($get{map}) or undef $get{map};