From e2066947933f9666f75321ff77e68e166cf3de27 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sat, 27 Jan 2024 21:36:47 +0100 Subject: [PATCH] keyboard/altgr: override unidecode transliterations Move apl symbol exceptions to the shared lookup function. --- Shiar_Sheet/KeyboardChars.pm | 13 +++++++++++-- keyboard/altgr/apl.eng.inc.pl | 1 - 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Shiar_Sheet/KeyboardChars.pm b/Shiar_Sheet/KeyboardChars.pm index 77be120..c5b0a09 100644 --- a/Shiar_Sheet/KeyboardChars.pm +++ b/Shiar_Sheet/KeyboardChars.pm @@ -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}); } diff --git a/keyboard/altgr/apl.eng.inc.pl b/keyboard/altgr/apl.eng.inc.pl index 81dcd0c..c796cb3 100644 --- a/keyboard/altgr/apl.eng.inc.pl +++ b/keyboard/altgr/apl.eng.inc.pl @@ -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']; -- 2.30.0