Skip to content

move props bmg bpb EqUIdeo from misc to string #383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions unicodetools/data/ucd/dev/BidiBrackets.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# BidiBrackets-15.1.0.txt
# Date: 2023-01-05
# Date: 2023-01-18
# © 2023 Unicode®, Inc.
# Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries.
# For terms of use, see https://www.unicode.org/terms_of_use.html
Expand All @@ -12,11 +12,11 @@
# This file is a normative contributory data file in the Unicode
# Character Database.
#
# Bidi_Paired_Bracket is a normative property of type Miscellaneous,
# Bidi_Paired_Bracket is a normative property
# which establishes a mapping between characters that are treated as
# bracket pairs by the Unicode Bidirectional Algorithm.
#
# Bidi_Paired_Bracket_Type is a normative property of type Enumeration,
# Bidi_Paired_Bracket_Type is a normative property
# which classifies characters into opening and closing paired brackets
# for the purposes of the Unicode Bidirectional Algorithm.
#
Expand Down
6 changes: 3 additions & 3 deletions unicodetools/data/ucd/dev/PropertyAliases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ nv ; Numeric_Value
# ================================================
# String Properties
# ================================================
bmg ; Bidi_Mirroring_Glyph
bpb ; Bidi_Paired_Bracket
cf ; Case_Folding
cjkCompatibilityVariant ; kCompatibilityVariant
dm ; Decomposition_Mapping
EqUIdeo ; Equivalent_Unified_Ideograph
FC_NFKC ; FC_NFKC_Closure
lc ; Lowercase_Mapping
NFKC_CF ; NFKC_Casefold
Expand All @@ -80,8 +83,6 @@ uc ; Uppercase_Mapping
# ================================================
# Miscellaneous Properties
# ================================================
bmg ; Bidi_Mirroring_Glyph
bpb ; Bidi_Paired_Bracket
cjkIICore ; kIICore
cjkIRG_GSource ; kIRG_GSource
cjkIRG_HSource ; kIRG_HSource
Expand All @@ -95,7 +96,6 @@ cjkIRG_UKSource ; kIRG_UKSource
cjkIRG_USource ; kIRG_USource
cjkIRG_VSource ; kIRG_VSource
cjkRSUnicode ; kRSUnicode ; Unicode_Radical_Stroke; URS
EqUIdeo ; Equivalent_Unified_Ideograph
isc ; ISO_Comment
JSN ; Jamo_Short_Name
na ; Name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public enum UcdProperty {
Confusable_SA(PropertyType.String, "ConfSA"),
Confusable_SL(PropertyType.String, "ConfSL"),
Decomposition_Mapping(PropertyType.String, "dm"),
Equivalent_Unified_Ideograph(PropertyType.String, "EqUIdeo"),
FC_NFKC_Closure(PropertyType.String, "FC_NFKC"),
Idn_Mapping(PropertyType.String, "idnm"),
Lowercase_Mapping(PropertyType.String, "lc"),
Expand All @@ -76,7 +77,6 @@ public enum UcdProperty {
Emoji_DCM(PropertyType.Miscellaneous, "EDCM"),
Emoji_KDDI(PropertyType.Miscellaneous, "EKDDI"),
Emoji_SB(PropertyType.Miscellaneous, "ESB"),
Equivalent_Unified_Ideograph(PropertyType.Miscellaneous, "EqUIdeo"),
ISO_Comment(PropertyType.Miscellaneous, "isc"),
Jamo_Short_Name(PropertyType.Miscellaneous, "JSN"),
Name(PropertyType.Miscellaneous, "na"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,7 @@ private static void printDefaultValueComment(
if (defaultValue != null) {
// ok
} else if (propName.equals("Bidi_Mirroring_Glyph")
|| propName.equals("Bidi_Paired_Bracket")
|| propName.equals("ISO_Comment")
|| propName.equals("Name")
|| propName.equals("Unicode_Radical_Stroke")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ private ToolUnicodePropertySource(String version) {
UnicodeSet Zwj = new UnicodeSet(0x200D, 0x200D).freeze();

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

// first the special cases
if (DEBUG) {
Expand Down Expand Up @@ -515,7 +519,11 @@ public String _getValue(int codepoint) {
return ucd.getBidiMirror(codepoint);
}
}.setValues("<string>")
.setMain("Bidi_Mirroring_Glyph", "bmg", UnicodeProperty.MISC, version));
.setMain(
"Bidi_Mirroring_Glyph",
"bmg",
isAtLeast15_1 ? UnicodeProperty.STRING : UnicodeProperty.MISC,
version));

add(
new UnicodeProperty.SimpleProperty() {
Expand All @@ -524,7 +532,11 @@ public String _getValue(int codepoint) {
return UTF16.valueOf(ucd.getBidi_Paired_Bracket(codepoint));
}
}.setValues("<string>")
.setMain("Bidi_Paired_Bracket", "bpb", UnicodeProperty.MISC, version));
.setMain(
"Bidi_Paired_Bracket",
"bpb",
isAtLeast15_1 ? UnicodeProperty.STRING : UnicodeProperty.MISC,
version));

BaseProperty bpt =
new UnicodeProperty.SimpleProperty() {
Expand Down