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"],