- $info{key}{$lead.$c} = join "\n", $glyph, $title;
-
- my $class = 'g'.(
- !defined $v || $c eq $v ? 1 # identical
- : $v =~ /\A\p{Mn}+\z/ ? 9 # combining accent
- : $v =~ /\A[\p{Sk}\p{Lm}]+\z/ ? 8 # modifier symbol
- : $v =~ /\A[\pM\pP]+\z/ ? 7 # mark
- : NFKD($v) =~ /\Q$c/ ? 2 # decomposed equivalent
- : unidecode($v) =~ /\Q$c\E+/i ? 4 # transliterated
- : $v =~ /^\p{Latin}/ ? 5 # latin script
- : 6
+ $info{key}{$lead.$k} = join "\n", $glyph, $title;
+ my $c = $k =~ s/\A[+^](?=.)//r; # trim modifier indicator
+
+ unshift @class, (
+ !defined $v || $c eq $v ? 'no' # identical
+ : $v =~ /\A\p{Mn}+\z/ ? 'g9' # combining accent
+ : NFKD($v) =~ /\A\Q$c\E\p{Mn}*\z/ ? 'g2' # decomposed equivalent
+ : unidecode($v) =~ /\Q$c\E+/i ? 'g4' # transliterated
+ : $v =~ /\A[\p{Sk}\p{Lm}]+\z/ ? 'g8' # modifier symbol
+ : $v =~ /\A[\pM\pP]+\z/ ? 'g7' # mark
+ : $v =~ /^\p{Latin}/ ? 'g5' # latin script
+ : 'g6'