Skip to content

Commit 6df8f96

Browse files
authored
Linkification in IndexUnicodeProperties & ExtraProperty(Value)Aliases (#1263)
* IndexUnicodeProperties, ExtraPropertyAliases, ExtraPropertyValueAliases * GenerateEnums * format * Two bugs, each of which would pin LinkEmail to 17.0 * Markus’s review * Markus’s review * Another ICU property trying to sneak into Link_* property derivations * ! is exceptional for Link_Email
1 parent fa879ad commit 6df8f96

File tree

6 files changed

+67
-1
lines changed

6 files changed

+67
-1
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.unicode.props.UcdPropertyValues.Joining_Group_Values;
2828
import org.unicode.props.UcdPropertyValues.Joining_Type_Values;
2929
import org.unicode.props.UcdPropertyValues.Line_Break_Values;
30+
import org.unicode.props.UcdPropertyValues.Link_Term_Values;
3031
import org.unicode.props.UcdPropertyValues.Math_Class_Ex_Values;
3132
import org.unicode.props.UcdPropertyValues.Math_Class_Values;
3233
import org.unicode.props.UcdPropertyValues.NFC_Quick_Check_Values;
@@ -98,6 +99,7 @@ public enum UcdProperty {
9899
Equivalent_Unified_Ideograph(PropertyType.String, DerivedPropertyStatus.Approved, "EqUIdeo"),
99100
FC_NFKC_Closure(PropertyType.String, DerivedPropertyStatus.Approved, "FC_NFKC"),
100101
Idn_Mapping(PropertyType.String, DerivedPropertyStatus.NonUCDNonProperty, "idnm"),
102+
Link_Bracket(PropertyType.String, DerivedPropertyStatus.NonUCDProperty, "Link_Bracket"),
101103
Lowercase_Mapping(PropertyType.String, DerivedPropertyStatus.Approved, "lc"),
102104
NFKC_Casefold(PropertyType.String, DerivedPropertyStatus.Approved, "NFKC_CF"),
103105
NFKC_Simple_Casefold(PropertyType.String, DerivedPropertyStatus.Approved, "NFKC_SCF"),
@@ -761,6 +763,12 @@ public enum UcdProperty {
761763
Line_Break_Values.class,
762764
null,
763765
"lb"),
766+
Link_Term(
767+
PropertyType.Enumerated,
768+
DerivedPropertyStatus.NonUCDProperty,
769+
Link_Term_Values.class,
770+
null,
771+
"Link_Term"),
764772
Math_Class(
765773
PropertyType.Enumerated,
766774
DerivedPropertyStatus.NonUCDProperty,
@@ -921,6 +929,12 @@ public enum UcdProperty {
921929
ID_Start(PropertyType.Binary, DerivedPropertyStatus.Approved, Binary.class, null, "IDS"),
922930
Ideographic(PropertyType.Binary, DerivedPropertyStatus.Approved, Binary.class, null, "Ideo"),
923931
Join_Control(PropertyType.Binary, DerivedPropertyStatus.Approved, Binary.class, null, "Join_C"),
932+
Link_Email(
933+
PropertyType.Binary,
934+
DerivedPropertyStatus.NonUCDProperty,
935+
Binary.class,
936+
null,
937+
"Link_Email"),
924938
Logical_Order_Exception(
925939
PropertyType.Binary, DerivedPropertyStatus.Approved, Binary.class, null, "LOE"),
926940
Lowercase(PropertyType.Binary, DerivedPropertyStatus.Approved, Binary.class, null, "Lower"),

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,6 +1890,39 @@ public static Line_Break_Values forName(String name) {
18901890
}
18911891
}
18921892

1893+
// Link_Bracket
1894+
public enum Link_Term_Values implements Named {
1895+
Include("Include"),
1896+
Hard("Hard"),
1897+
Soft("Soft"),
1898+
Close("Close"),
1899+
Open("Open");
1900+
private final PropertyNames<Link_Term_Values> names;
1901+
1902+
private Link_Term_Values(String shortName, String... otherNames) {
1903+
names =
1904+
new PropertyNames<Link_Term_Values>(
1905+
Link_Term_Values.class, this, shortName, otherNames);
1906+
}
1907+
1908+
@Override
1909+
public PropertyNames<Link_Term_Values> getNames() {
1910+
return names;
1911+
}
1912+
1913+
@Override
1914+
public String getShortName() {
1915+
return names.getShortName();
1916+
}
1917+
1918+
private static final NameMatcher<Link_Term_Values> NAME_MATCHER =
1919+
PropertyNames.getNameToEnums(Link_Term_Values.class);
1920+
1921+
public static Link_Term_Values forName(String name) {
1922+
return NAME_MATCHER.get(name);
1923+
}
1924+
}
1925+
18931926
// Lowercase_Mapping
18941927
public enum Math_Class_Values implements Named {
18951928
None("None"),

unicodetools/src/main/resources/org/unicode/props/ExtraPropertyAliases.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ REKS ; RGI_Emoji_Keycap_Sequence ; Emoji_Keycap_Sequence ; Emoji_Combining_Seque
99
RETS ; RGI_Emoji_Tag_Sequence ; Emoji_Tag_Sequence ; NonUCDProperty
1010
REZS ; RGI_Emoji_Zwj_Sequence ; Emoji_Zwj_Sequence ; NonUCDProperty
1111
RGI_Emoji ; RGI_Emoji ; NonUCDProperty
12+
Link_Email ; Link_Email ; NonUCDProperty
1213

1314
# ================================================
1415
# Enumerated Properties
@@ -38,6 +39,8 @@ Math_Class ; Math_Class ; NonUCDProperty
3839
# characters for which it historically lagged behind the value in MathClass.
3940
Math_Class_Ex ; Math_Class_Ex ; NonUCDNonProperty
4041

42+
Link_Term ; Link_Term ; NonUCDProperty
43+
4144
# ================================================
4245
# Numeric Properties
4346
# ================================================
@@ -87,6 +90,8 @@ kSEAL_MCJK ; kSEAL_MCJK ; Provisional
8790

8891
Names_List_Cross_Ref ; Names_List_Cross_Ref ; UCDNonProperty
8992

93+
Link_Bracket ; Link_Bracket ; NonUCDProperty
94+
9095
# ================================================
9196
# Miscellaneous Properties
9297
# ================================================

unicodetools/src/main/resources/org/unicode/props/ExtraPropertyValueAliases.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
# @missing: 0000..10FFFF; kEH_NoMirror ; No
9090
# @missing: 0000..10FFFF; kEH_NoRotate ; No
9191

92+
# @missing: 0000..10FFFF; Link_Email ; No
93+
9294
# End of binary properties.
9395

9496
# @missing: 0000..10FFFF; Canonical_Combining_Class; Not_Reordered
@@ -447,6 +449,12 @@ Math_Class_Ex ; U ; Unary
447449
Math_Class_Ex ; V ; Vary
448450
Math_Class_Ex ; X ; Special
449451

452+
Link_Term ; Include ; Include
453+
Link_Term ; Hard ; Hard
454+
Link_Term ; Soft ; Soft
455+
Link_Term ; Close ; Close
456+
Link_Term ; Open ; Open
457+
450458
# @missing: 0000..10FFFF; kVietnameseNumeric ; NaN
451459
# @missing: 0000..10FFFF; kZhuangNumeric ; NaN
452460
# @missing: 0000..10FFFF; kTayNumeric ; NaN

unicodetools/src/main/resources/org/unicode/props/IndexUnicodeProperties.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ FileType ; UnicodeData ; HackField
2121
# Contains exactly one boolean property, with value "Yes"
2222

2323
FileType ; CompositionExclusions ; List
24+
FileType ; linkification/*/LinkEmail ; List
2425

2526
# PropertyValue File Type
2627
# The value is in field 2, except for binary properties, where the value is "Yes"
@@ -529,6 +530,10 @@ security/*/confusables ; Confusable_SA
529530
security/*/confusables ; Confusable_ML
530531
security/*/confusables ; Confusable_MA
531532

533+
linkification/*/LinkBracket ; Link_Bracket
534+
linkification/*/LinkTerm ; Link_Term
535+
linkification/*/LinkEmail ; Link_Email
536+
532537
# Unicode 13 moves the emoji-data.txt and emoji-variation-sequences.txt files
533538
# from the emoji folder to the ucd/emoji folder.
534539
# The line with the new location (i.e., the line without version number)

unicodetools/src/main/resources/org/unicode/text/UCD/AdditionComparisons/179.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ Propertywise [\x{2E60} \N{WIGGLY EXCLAMATION MARK}
2222
\x{2E61} \N{INVERTED WIGGLY EXCLAMATION MARK}]
2323
CorrespondTo [\x{0021} ! \N{EXCLAMATION MARK}]
2424
UpTo: East_Asian_Width (Neutral vs Narrow),
25-
Block (Supplemental_Punctuation vs Basic_Latin)
25+
Block (Supplemental_Punctuation vs Basic_Latin),
26+
Link_Email (No vs Yes)
2627

2728
end Ignoring;
2829

0 commit comments

Comments
 (0)