Skip to content

Commit

Permalink
Remove the shim made redundant by unicode-org#657
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin committed Feb 2, 2024
1 parent 0812d65 commit f986f63
Showing 1 changed file with 2 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public ShimUnicodePropertyFactory(IndexUnicodeProperties factory) {
for (String propName : factory.getAvailableNames()) {
UnicodeProperty prop = factory.getProperty(propName);
switch (propName) {
// The default is <none> in BidiMirroring.txt, but TUP incorrectly has it as
// <code point>.
case "Bidi_Mirroring_Glyph":
prop =
replaceCpValues(
Expand All @@ -72,12 +74,6 @@ public ShimUnicodePropertyFactory(IndexUnicodeProperties factory) {
replaceCpValues(
prop, (cp, oldValue) -> fixFC_NFKC_Closure(cp, oldValue));

break;
case "Joining_Type":
prop = replaceCpValues(prop, (cp, oldValue) -> fixJoining_Type(cp, oldValue));
break;
case "Joining_Group":
prop = modifyJoining_Group(prop);
break;
case "Jamo_Short_Name":
prop = modifyJamo_Short_Name(prop);
Expand Down Expand Up @@ -316,25 +312,11 @@ private String fixFC_NFKC_Closure(int cp, String oldValue) {
}
}

// Joining_Type needs fix in IUP
private String fixJoining_Type(int cp, String oldValue) {
if (defaultTransparent.contains(cp) && "Non_Joining".equals(oldValue)) {
return "Transparent";
} else {
return oldValue;
}
}

// Jamo_Short_Name needs fix in IUP
private UnicodeProperty modifyJamo_Short_Name(UnicodeProperty prop) {
return copyPropReplacingMap(prop, prop.getUnicodeMap().put('ᄋ', ""));
}

// Joining_Group needs fix in IUP (really, in UCD data)
private UnicodeProperty modifyJoining_Group(UnicodeProperty prop) {
return copyPropReplacingMap(prop, prop.getUnicodeMap().put('ۃ', "Teh_Marbuta_Goal"));
}

/** Very useful. May already be in ICU, but not sure. */
public boolean equalsString(int codepoint, String value) {
return codepoint == value.codePointAt(0)
Expand Down

0 comments on commit f986f63

Please sign in to comment.