git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
keyboard/altgr: classify lookalike symbols as transliterated
[sheet.git]
/
Shiar_Sheet
/
KeyboardChars.pm
diff --git
a/Shiar_Sheet/KeyboardChars.pm
b/Shiar_Sheet/KeyboardChars.pm
index 6afd7dce4cf1b7619d9aff5b9ab0e784692fc812..77be1209c6f5078125b6d65abe09296883f0b6b1 100644
(file)
--- a/
Shiar_Sheet/KeyboardChars.pm
+++ b/
Shiar_Sheet/KeyboardChars.pm
@@
-8,7
+8,7
@@
use Unicode::Normalize qw( NFKD );
use Text::Unidecode qw( unidecode );
use Shiar_Sheet::FormatChar;
use Text::Unidecode qw( unidecode );
use Shiar_Sheet::FormatChar;
-our $VERSION = '1.0
0
';
+our $VERSION = '1.0
1
';
our @EXPORT = qw( kbchars kbmodes );
my $uc = Shiar_Sheet::FormatChar->new;
our @EXPORT = qw( kbchars kbmodes );
my $uc = Shiar_Sheet::FormatChar->new;
@@
-36,10
+36,10
@@
sub kbmodes ($modes) {
my $class = 'g'.(
!defined $v || $c eq $v ? 1 # identical
: $v =~ /\A\p{Mn}+\z/ ? 9 # combining accent
my $class = 'g'.(
!defined $v || $c eq $v ? 1 # identical
: $v =~ /\A\p{Mn}+\z/ ? 9 # combining accent
- : $v =~ /\A[\p{Sk}\p{Lm}]+\z/ ? 8 # modifier symbol
- : $v =~ /\A[\pM\pP]+\z/ ? 7 # mark
: NFKD($v) =~ /\Q$c/ ? 2 # decomposed equivalent
: unidecode($v) =~ /\Q$c\E+/i ? 4 # transliterated
: NFKD($v) =~ /\Q$c/ ? 2 # decomposed equivalent
: unidecode($v) =~ /\Q$c\E+/i ? 4 # transliterated
+ : $v =~ /\A[\p{Sk}\p{Lm}]+\z/ ? 8 # modifier symbol
+ : $v =~ /\A[\pM\pP]+\z/ ? 7 # mark
: $v =~ /^\p{Latin}/ ? 5 # latin script
: 6
);
: $v =~ /^\p{Latin}/ ? 5 # latin script
: 6
);