X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/fe3830a0e28e28ea18335cc81af2faac447fc69a..497b99dabe402a5a00d640db547e28c87bf602bc:/keyboard.eng.inc.pl
diff --git a/keyboard.eng.inc.pl b/keyboard.eng.inc.pl
index ff2d8e2..efbdad1 100644
--- a/keyboard.eng.inc.pl
+++ b/keyboard.eng.inc.pl
@@ -1,53 +1,25 @@
-use utf8;
use Unicode::Normalize qw( NFKD );
use Text::Unidecode qw( unidecode );
-my @usintrows = (
- [ 'a' .. 'z'],
- [qw(à B ¢ à à F G H à J Šà µ à à à à ® § à à V Ã
X Ã Ã)],
- [qw(á b © ð é f g h à j Šø µ ñ ó ö ä ® à þ ú v å x ü æ)],
- [qw(Ã
ı à ð ´ Ì Ë Ì£ Ë Â½  à ¾ Ë Ã â Å â° / Ë Â¨ â â Ë Â¼ ¸)],
- [qw(Ã¥ ⫠ç â Ì Æ Â© Ë Ì â ° ¬ µ Ì Ã¸ Ï Å Â® à â Ì â â â Â¥ Ω)],
-);
-my @usint = (
- map {
- my $c = $_;
- [ map { $usintrows[$_]->[$c] } 0 .. 2 ]
- } 0 .. $#{ $usintrows[0] }
-);
-
{
- title => 'keyboard',
- version => '1.2',
- description => [
- "Windows US international keyboard layout table",
- "with the AltGr modifier key.",
- ],
- intro => 'Special characters returned with the AltGr modifier
-for the Windows US international layout.',
- rows => [0],
-
+ rows => [0, 1],
def => {
'' => {
map {
- my @row = @{$_};
+ my $v = $rows{$_};
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
+ !defined $v || $_ eq $v ? 1 # identical
+ : $v =~ /\A\p{Mn}+\z/ ? 8 # combining accent
+ : NFKD($v) =~ $_ ? 2 # decomposed equivalent
+ : $v =~ /^\p{Latin}/ ? 4 # latin script
+ : unidecode($v) =~ /^\W*\Q$_/ ? 5 # transliterated
: 7
);
- $row[0] => "g$class"
- } @usint
+ $_ => "g$class"
+ } keys %rows
},
},
- key => {
- map {
- $_->[0] => "$_->[1]
$_->[2]"
- } @usint
- },
+ key => \%rows,
flag => {
g1 => ['unaltered', "same results as without modifier"],
g2 => ['accented', "decomposes to the original letter with a combining accent"],