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