summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
17e692e)
Character type distinction (spacing diacritic or punctuation) deemed less
significant.
use Text::Unidecode qw( unidecode );
use Shiar_Sheet::FormatChar;
use Text::Unidecode qw( unidecode );
use Shiar_Sheet::FormatChar;
our @EXPORT = qw( kbchars kbmodes );
my $uc = Shiar_Sheet::FormatChar->new;
our @EXPORT = qw( kbchars kbmodes );
my $uc = Shiar_Sheet::FormatChar->new;
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
);
use utf8;
use strict;
use warnings;
use utf8;
use strict;
use warnings;
use Shiar_Sheet::KeyboardChars 'kbchars';
my %rows = (
use Shiar_Sheet::KeyboardChars 'kbchars';
my %rows = (
qw( { [ } ] " ' | \ < , > . ? / ` 3 ~ = ),
(map {uc, lc} qw[ r t y u i o p h j m ]),
);
qw( { [ } ] " ' | \ < , > . ? / ` 3 ~ = ),
(map {uc, lc} qw[ r t y u i o p h j m ]),
);
+$rows{$_} = $rows{ $shift{$_} } for keys %shift; # alias shifted
my $groups = kbchars(\%rows);
$groups->{flag}{ext} = ['alias', 'identical results from unshifted key'];
my $groups = kbchars(\%rows);
$groups->{flag}{ext} = ['alias', 'identical results from unshifted key'];
-while (my ($alias, $target) = each %shift) {
- # copy alias to shifted
- $groups->{key}{$alias} = $groups->{key}{$target};
- $groups->{def}{''}{$alias} = $groups->{def}{''}{$target}.' ext';
-}
-$groups->{def}{''}{$_} =~ s/g7/g4/ for qw( ! < > ? ); # similar punctuation
+$groups->{def}{''}{$_} .= ' ext' for keys %shift; # mark aliases