Skip to content

Commit 1d40037

Browse files
committed
move 3 props from misc to string, adjust generator
1 parent 4f97cb6 commit 1d40037

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

unicodetools/data/ucd/dev/PropertyAliases.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,12 @@ nv ; Numeric_Value
6464
# ================================================
6565
# String Properties
6666
# ================================================
67+
bmg ; Bidi_Mirroring_Glyph
68+
bpb ; Bidi_Paired_Bracket
6769
cf ; Case_Folding
6870
cjkCompatibilityVariant ; kCompatibilityVariant
6971
dm ; Decomposition_Mapping
72+
EqUIdeo ; Equivalent_Unified_Ideograph
7073
FC_NFKC ; FC_NFKC_Closure
7174
lc ; Lowercase_Mapping
7275
NFKC_CF ; NFKC_Casefold
@@ -80,8 +83,6 @@ uc ; Uppercase_Mapping
8083
# ================================================
8184
# Miscellaneous Properties
8285
# ================================================
83-
bmg ; Bidi_Mirroring_Glyph
84-
bpb ; Bidi_Paired_Bracket
8586
cjkIICore ; kIICore
8687
cjkIRG_GSource ; kIRG_GSource
8788
cjkIRG_HSource ; kIRG_HSource
@@ -95,7 +96,6 @@ cjkIRG_UKSource ; kIRG_UKSource
9596
cjkIRG_USource ; kIRG_USource
9697
cjkIRG_VSource ; kIRG_VSource
9798
cjkRSUnicode ; kRSUnicode ; Unicode_Radical_Stroke; URS
98-
EqUIdeo ; Equivalent_Unified_Ideograph
9999
isc ; ISO_Comment
100100
JSN ; Jamo_Short_Name
101101
na ; Name

unicodetools/src/main/java/org/unicode/props/UcdProperty.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public enum UcdProperty {
5555
Confusable_SA(PropertyType.String, "ConfSA"),
5656
Confusable_SL(PropertyType.String, "ConfSL"),
5757
Decomposition_Mapping(PropertyType.String, "dm"),
58+
Equivalent_Unified_Ideograph(PropertyType.String, "EqUIdeo"),
5859
FC_NFKC_Closure(PropertyType.String, "FC_NFKC"),
5960
Idn_Mapping(PropertyType.String, "idnm"),
6061
Lowercase_Mapping(PropertyType.String, "lc"),
@@ -76,7 +77,6 @@ public enum UcdProperty {
7677
Emoji_DCM(PropertyType.Miscellaneous, "EDCM"),
7778
Emoji_KDDI(PropertyType.Miscellaneous, "EKDDI"),
7879
Emoji_SB(PropertyType.Miscellaneous, "ESB"),
79-
Equivalent_Unified_Ideograph(PropertyType.Miscellaneous, "EqUIdeo"),
8080
ISO_Comment(PropertyType.Miscellaneous, "isc"),
8181
Jamo_Short_Name(PropertyType.Miscellaneous, "JSN"),
8282
Name(PropertyType.Miscellaneous, "na"),

unicodetools/src/main/java/org/unicode/text/UCD/MakeUnicodeFiles.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,7 @@ private static void printDefaultValueComment(
10241024
if (defaultValue != null) {
10251025
// ok
10261026
} else if (propName.equals("Bidi_Mirroring_Glyph")
1027+
|| propName.equals("Bidi_Paired_Bracket")
10271028
|| propName.equals("ISO_Comment")
10281029
|| propName.equals("Name")
10291030
|| propName.equals("Unicode_Radical_Stroke")

unicodetools/src/main/java/org/unicode/text/UCD/ToolUnicodePropertySource.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ private ToolUnicodePropertySource(String version) {
125125
UnicodeSet Zwj = new UnicodeSet(0x200D, 0x200D).freeze();
126126

127127
version = ucd.getVersion(); // regularize
128+
// Unicode 15.1 reclassifies some properties from miscellaneous to string.
129+
// TODO: Try to get the classification from parsing PropertyAliases.txt rather than hardcode
130+
// it.
131+
boolean isAtLeast15_1 = ucd.getCompositeVersion() >= 0x0f0100;
128132

129133
// first the special cases
130134
if (DEBUG) {
@@ -515,7 +519,11 @@ public String _getValue(int codepoint) {
515519
return ucd.getBidiMirror(codepoint);
516520
}
517521
}.setValues("<string>")
518-
.setMain("Bidi_Mirroring_Glyph", "bmg", UnicodeProperty.MISC, version));
522+
.setMain(
523+
"Bidi_Mirroring_Glyph",
524+
"bmg",
525+
isAtLeast15_1 ? UnicodeProperty.STRING : UnicodeProperty.MISC,
526+
version));
519527

520528
add(
521529
new UnicodeProperty.SimpleProperty() {
@@ -524,7 +532,11 @@ public String _getValue(int codepoint) {
524532
return UTF16.valueOf(ucd.getBidi_Paired_Bracket(codepoint));
525533
}
526534
}.setValues("<string>")
527-
.setMain("Bidi_Paired_Bracket", "bpb", UnicodeProperty.MISC, version));
535+
.setMain(
536+
"Bidi_Paired_Bracket",
537+
"bpb",
538+
isAtLeast15_1 ? UnicodeProperty.STRING : UnicodeProperty.MISC,
539+
version));
528540

529541
BaseProperty bpt =
530542
new UnicodeProperty.SimpleProperty() {

0 commit comments

Comments
 (0)