@@ -10,46 +10,11 @@ public class AttributeResolver {
1010
1111 private final IndexUnicodeProperties indexUnicodeProperties ;
1212 private final UnicodeMap <UcdPropertyValues .Age_Values > map_age ;
13- private final UnicodeMap <UcdPropertyValues .Bidi_Class_Values > map_bidi_class ;
14- private final UnicodeMap <UcdPropertyValues .Bidi_Paired_Bracket_Type_Values >
15- map_bidi_paired_bracket_type ;
1613 private final UnicodeMap <UcdPropertyValues .Block_Values > map_block ;
17- private final UnicodeMap <UcdPropertyValues .Canonical_Combining_Class_Values >
18- map_canonical_combining_class ;
1914 private final UnicodeMap <UcdPropertyValues .Decomposition_Type_Values > map_decomposition_type ;
20- private final UnicodeMap <UcdPropertyValues .Do_Not_Emit_Type_Values > map_do_not_emit_type ;
21- private final UnicodeMap <UcdPropertyValues .East_Asian_Width_Values > map_east_asian_width ;
2215 private final UnicodeMap <UcdPropertyValues .General_Category_Values > map_general_category ;
23- private final UnicodeMap <UcdPropertyValues .Grapheme_Cluster_Break_Values >
24- map_grapheme_cluster_break ;
25- private final UnicodeMap <UcdPropertyValues .Hangul_Syllable_Type_Values >
26- map_hangul_syllable_type ;
27- private final UnicodeMap <UcdPropertyValues .Identifier_Status_Values > map_identifier_status ;
28- private final UnicodeMap <UcdPropertyValues .Identifier_Type_Values > map_identifier_type ;
29- private final UnicodeMap <UcdPropertyValues .Idn_2008_Values > map_idn_2008 ;
30- private final UnicodeMap <UcdPropertyValues .Idn_Status_Values > map_idn_status ;
31- private final UnicodeMap <UcdPropertyValues .Indic_Conjunct_Break_Values >
32- map_indic_conjunct_break ;
33- private final UnicodeMap <UcdPropertyValues .Indic_Positional_Category_Values >
34- map_indic_positional_category ;
35- private final UnicodeMap <UcdPropertyValues .Indic_Syllabic_Category_Values >
36- map_indic_syllabic_category ;
37- private final UnicodeMap <UcdPropertyValues .Jamo_Short_Name_Values > map_jamo_short_name ;
38- private final UnicodeMap <UcdPropertyValues .Joining_Group_Values > map_joining_group ;
39- private final UnicodeMap <UcdPropertyValues .Joining_Type_Values > map_joining_type ;
40- private final UnicodeMap <UcdPropertyValues .Line_Break_Values > map_line_break ;
41- private final UnicodeMap <UcdPropertyValues .NFC_Quick_Check_Values > map_nfc_quick_check ;
42- private final UnicodeMap <UcdPropertyValues .NFD_Quick_Check_Values > map_nfd_quick_check ;
43- private final UnicodeMap <UcdPropertyValues .NFKC_Quick_Check_Values > map_nfkc_quick_check ;
44- private final UnicodeMap <UcdPropertyValues .NFKD_Quick_Check_Values > map_nfkd_quick_check ;
45- private final UnicodeMap <UcdPropertyValues .Numeric_Type_Values > map_numeric_type ;
46- private final UnicodeMap <UcdPropertyValues .Other_Joining_Type_Values > map_other_joining_type ;
4716 private final UnicodeMap <UcdPropertyValues .Script_Values > map_script ;
4817 private final UnicodeMap <String > map_script_extensions ;
49- private final UnicodeMap <UcdPropertyValues .Sentence_Break_Values > map_sentence_break ;
50- private final UnicodeMap <UcdPropertyValues .Vertical_Orientation_Values >
51- map_vertical_orientation ;
52- private final UnicodeMap <UcdPropertyValues .Word_Break_Values > map_word_break ;
5318 private final HashMap <Integer , LinkedList <NameAlias >> map_NameAlias ;
5419
5520 // If there is a change in any of these properties between two adjacent characters, it will
@@ -67,47 +32,12 @@ public class AttributeResolver {
6732 public AttributeResolver (IndexUnicodeProperties iup ) {
6833 indexUnicodeProperties = iup ;
6934 map_age = indexUnicodeProperties .loadEnum (UcdProperty .Age );
70- map_bidi_class = indexUnicodeProperties .loadEnum (UcdProperty .Bidi_Class );
71- map_bidi_paired_bracket_type =
72- indexUnicodeProperties .loadEnum (UcdProperty .Bidi_Paired_Bracket_Type );
7335 map_block = indexUnicodeProperties .loadEnum (UcdProperty .Block );
74- map_canonical_combining_class =
75- indexUnicodeProperties .loadEnum (UcdProperty .Canonical_Combining_Class );
7636 map_decomposition_type = indexUnicodeProperties .loadEnum (UcdProperty .Decomposition_Type );
77- map_do_not_emit_type = indexUnicodeProperties .loadEnum (UcdProperty .Do_Not_Emit_Type );
78- map_east_asian_width = indexUnicodeProperties .loadEnum (UcdProperty .East_Asian_Width );
7937 map_general_category = indexUnicodeProperties .loadEnum (UcdProperty .General_Category );
80- map_grapheme_cluster_break =
81- indexUnicodeProperties .loadEnum (UcdProperty .Grapheme_Cluster_Break );
82- map_hangul_syllable_type =
83- indexUnicodeProperties .loadEnum (UcdProperty .Hangul_Syllable_Type );
84- map_identifier_status = indexUnicodeProperties .loadEnum (UcdProperty .Identifier_Status );
85- map_identifier_type = indexUnicodeProperties .loadEnum (UcdProperty .Identifier_Type );
86- map_idn_2008 = indexUnicodeProperties .loadEnum (UcdProperty .Idn_2008 );
87- map_idn_status = indexUnicodeProperties .loadEnum (UcdProperty .Idn_Status );
88- map_indic_conjunct_break =
89- indexUnicodeProperties .loadEnum (UcdProperty .Indic_Conjunct_Break );
90- map_indic_positional_category =
91- indexUnicodeProperties .loadEnum (UcdProperty .Indic_Positional_Category );
92- map_indic_syllabic_category =
93- indexUnicodeProperties .loadEnum (UcdProperty .Indic_Syllabic_Category );
94- map_jamo_short_name = indexUnicodeProperties .loadEnum (UcdProperty .Jamo_Short_Name );
95- map_joining_group = indexUnicodeProperties .loadEnum (UcdProperty .Joining_Group );
96- map_joining_type = indexUnicodeProperties .loadEnum (UcdProperty .Joining_Type );
97- map_line_break = indexUnicodeProperties .loadEnum (UcdProperty .Line_Break );
98- map_nfc_quick_check = indexUnicodeProperties .loadEnum (UcdProperty .NFC_Quick_Check );
99- map_nfd_quick_check = indexUnicodeProperties .loadEnum (UcdProperty .NFD_Quick_Check );
100- map_nfkc_quick_check = indexUnicodeProperties .loadEnum (UcdProperty .NFKC_Quick_Check );
101- map_nfkd_quick_check = indexUnicodeProperties .loadEnum (UcdProperty .NFKD_Quick_Check );
102- map_numeric_type = indexUnicodeProperties .loadEnum (UcdProperty .Numeric_Type );
103- map_other_joining_type = indexUnicodeProperties .loadEnum (UcdProperty .Other_Joining_Type );
10438 map_script = indexUnicodeProperties .loadEnum (UcdProperty .Script );
10539 map_script_extensions =
10640 indexUnicodeProperties .getProperty (UcdProperty .Script_Extensions ).getUnicodeMap ();
107- map_sentence_break = indexUnicodeProperties .loadEnum (UcdProperty .Sentence_Break );
108- map_vertical_orientation =
109- indexUnicodeProperties .loadEnum (UcdProperty .Vertical_Orientation );
110- map_word_break = indexUnicodeProperties .loadEnum (UcdProperty .Word_Break );
11141
11242 // UCD code is only set up to read a single Alias value from NameAliases.txt
11343 // Instead, we'll load the Alias and the Type data as part of the constructor. We'll keep in
@@ -295,69 +225,17 @@ public String getAttributeValue(UcdProperty prop, int codepoint) {
295225 }
296226 case Enumerated :
297227 switch (prop ) {
298- case Bidi_Class :
299- return map_bidi_class .get (codepoint ).getShortName ();
300- case Bidi_Paired_Bracket_Type :
301- return map_bidi_paired_bracket_type .get (codepoint ).getShortName ();
302- case Canonical_Combining_Class :
303- return map_canonical_combining_class .get (codepoint ).getShortName ();
304228 case Decomposition_Type :
305229 // Returning lower case to maintain compatibility with older generated
306230 // files.
307231 return map_decomposition_type
308232 .get (codepoint )
309233 .getShortName ()
310234 .toLowerCase (Locale .ROOT );
311- case Do_Not_Emit_Type :
312- return map_do_not_emit_type .get (codepoint ).getShortName ();
313- case East_Asian_Width :
314- return map_east_asian_width .get (codepoint ).getShortName ();
315- case General_Category :
316- return map_general_category .get (codepoint ).getShortName ();
317- case Grapheme_Cluster_Break :
318- return map_grapheme_cluster_break .get (codepoint ).getShortName ();
319- case Hangul_Syllable_Type :
320- return map_hangul_syllable_type .get (codepoint ).getShortName ();
321- case Identifier_Status :
322- return map_identifier_status .get (codepoint ).getShortName ();
323- case Identifier_Type :
324- return map_identifier_type .get (codepoint ).getShortName ();
325- case Idn_2008 :
326- return map_idn_2008 .get (codepoint ).getShortName ();
327- case Idn_Status :
328- return map_idn_status .get (codepoint ).getShortName ();
329- case Indic_Conjunct_Break :
330- return map_indic_conjunct_break .get (codepoint ).getShortName ();
331- case Indic_Positional_Category :
332- return map_indic_positional_category .get (codepoint ).getShortName ();
333- case Indic_Syllabic_Category :
334- return map_indic_syllabic_category .get (codepoint ).getShortName ();
335- case Joining_Group :
336- return map_joining_group .get (codepoint ).getShortName ();
337- case Joining_Type :
338- return map_joining_type .get (codepoint ).getShortName ();
339- case Line_Break :
340- return map_line_break .get (codepoint ).getShortName ();
341- case NFC_Quick_Check :
342- return map_nfc_quick_check .get (codepoint ).getShortName ();
343- case NFD_Quick_Check :
344- return map_nfd_quick_check .get (codepoint ).getShortName ();
345- case NFKC_Quick_Check :
346- return map_nfkc_quick_check .get (codepoint ).getShortName ();
347- case NFKD_Quick_Check :
348- return map_nfkd_quick_check .get (codepoint ).getShortName ();
349- case Numeric_Type :
350- return map_numeric_type .get (codepoint ).getShortName ();
351- case Other_Joining_Type :
352- return map_other_joining_type .get (codepoint ).getShortName ();
353- case Sentence_Break :
354- return map_sentence_break .get (codepoint ).getShortName ();
355- case Vertical_Orientation :
356- return map_vertical_orientation .get (codepoint ).getShortName ();
357- case Word_Break :
358- return map_word_break .get (codepoint ).getShortName ();
359235 default :
360- throw new RuntimeException ("Missing Enumerated case" );
236+ final UnicodeProperty property = indexUnicodeProperties .getProperty (prop );
237+ final List <String > valueAliases = property .getValueAliases (property .getValue (codepoint ));
238+ return valueAliases .get (0 );
361239 }
362240 case Binary :
363241 {
0 commit comments