1 use Unicode::Normalize qw( NFKD );
2 use Text::Unidecode qw( unidecode );
11 !defined $v || $_ eq $v ? 1 # identical
12 : $v =~ /\A\p{Mn}+\z/ ? 8 # combining accent
13 : NFKD($v) =~ $_ ? 2 # decomposed equivalent
14 : $v =~ /^\p{Latin}/ ? 4 # latin script
15 : unidecode($v) =~ /^\W*\Q$_/ ? 5 # transliterated
24 g1 => ['unaltered', "same results as without modifier"],
25 g2 => ['accented', "decomposes to the original letter with a combining accent"],
26 g4 => ['latin', "a different (accented) latin letter"],
27 g5 => ['similar', "transliterates (mostly) into the unmodified letter"],
28 g7 => ['other', "symbol not directly deducible from key"],
29 g8 => ['combining', "diacritical mark to be combined with a following character"],