3 use experimental 'signatures';
4 use Unicode::Normalize qw( NFKD );
5 use Text::Unidecode qw( unidecode );
6 use Shiar_Sheet::FormatChar;
8 my $uc = Shiar_Sheet::FormatChar->new;
11 my %g; # present group classes
19 !defined $v || $_ eq $v ? 1 # identical
20 : $v =~ /\A\p{Mn}+\z/ ? 9 # combining accent
21 : $v =~ /\A[\p{Sk}\p{Lm}]+\z/ ? 8 # modifier symbol
22 : $v =~ /\A[\pM\pP]+\z/ ? 7 # mark
23 : NFKD($v) =~ /\Q$_/ ? 2 # decomposed equivalent
24 : unidecode($v) =~ /\Q$_\E+/i ? 4 # transliterated
25 : $v =~ /^\p{Latin}/ ? 5 # latin script
35 my ($glyph, $title) = $uc->glyph_html($rows->{$_});
36 $_ => join "\n", $glyph, $title
40 g2 => ['accented', "decomposes to the original letter with a combining accent"],
41 g4 => ['similar', "transliterates (mostly) into the unmodified letter"],
42 g5 => ['latin', "a different (accented) latin letter"],
43 g6 => ['symbol', "other character not directly deducible from key"],
44 g7 => ['punctuation', "(punctuation) mark"],
45 g8 => ['mark', "modifier letter or mark (spacing diacritic)"],
46 g9 => ['combining', "diacritical mark to be combined with a following character"],