keyboard/altgr: override unidecode transliterations
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 27 Jan 2024 20:36:47 +0000 (21:36 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 29 Jan 2024 17:17:48 +0000 (18:17 +0100)
Move apl symbol exceptions to the shared lookup function.

Shiar_Sheet/KeyboardChars.pm
keyboard/altgr/apl.eng.inc.pl

index 77be1209c6f5078125b6d65abe09296883f0b6b1..c5b0a09f4502f7fd1928ca49c6ec09de2993a287 100644 (file)
@@ -2,17 +2,26 @@ package Shiar_Sheet::KeyboardChars;
 
 use 5.020;
 use warnings;
+use utf8;
 use experimental 'signatures';
 use parent 'Exporter';
 use Unicode::Normalize qw( NFKD );
-use Text::Unidecode qw( unidecode );
+use Text::Unidecode ();
 use Shiar_Sheet::FormatChar;
 
-our $VERSION = '1.01';
+our $VERSION = '1.02';
 our @EXPORT = qw( kbchars kbmodes );
 
 my $uc = Shiar_Sheet::FormatChar->new;
 
+our %unaccent = qw(
+       ⍺ a  ⍵ w  ∊ E  ⍷ E  ⍴ r  ⍳ i  ⍸ i  ○ O  ⍥ O  ⌿ /  ⍟ (*)
+);
+
+sub unidecode {
+       return $unaccent{$_[0]} // Text::Unidecode::unidecode($_[0]);
+}
+
 sub kbchars ($rows) {
        return kbmodes({'' => $rows});
 }
index 81dcd0c28bf9585806a1f3d845c41c61c2713855..c796cb31f61169737c74cb102addcd2529301e0a 100644 (file)
@@ -93,7 +93,6 @@ my %rows = (
 );
 
 my $groups = kbchars(\%rows);
-$groups->{def}{''}{$_} = 'g4' for split //,'weEriIoOa/*'; # lookalikes
 $groups->{def}{''}{$_} .= ' ext' for keys %dyalogx;
 $groups->{flag}{ext} = ['extended', 'optional operators not available in all variants'];