Skip to content

Commit

Permalink
Fix Extended_Pictographic in UnicodeProperty for JSP
Browse files Browse the repository at this point in the history
For #97
  • Loading branch information
srl295 committed Jul 20, 2021
1 parent 84a9500 commit 858a461
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions UnicodeJsps/src/main/java/org/unicode/jsp/ICUPropertyFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ protected ICUProperty(String propName, int propEnum) {
|| propEnum == UProperty.EMOJI_MODIFIER
|| propEnum == UProperty.EMOJI_MODIFIER_BASE
|| propEnum == UProperty.EMOJI_PRESENTATION
|| propEnum == UProperty.EXTENDED_PICTOGRAPHIC
) {
setUniformUnassigned(false);
}
Expand Down Expand Up @@ -144,7 +145,7 @@ private String getFixedValueAlias(int propId, String valueAlias, int valueEnum,
valueEnum = fixedGetPropertyValueEnum(propId,valueAlias);
}
// because these are defined badly, there may be no normal (long) name.
// if there is
// if there is
String result = fixedGetPropertyValueName(propId, valueEnum, nameChoice);
if (result != null) return result;
// HACK try other namechoice
Expand All @@ -158,7 +159,7 @@ private String getFixedValueAlias(int propId, String valueAlias, int valueEnum,
}

public boolean isCombiningClassProperty() {
return (propEnum == UProperty.CANONICAL_COMBINING_CLASS
return (propEnum == UProperty.CANONICAL_COMBINING_CLASS
|| propEnum == UProperty.LEAD_CANONICAL_COMBINING_CLASS
|| propEnum == UProperty.TRAIL_CANONICAL_COMBINING_CLASS
);
Expand Down Expand Up @@ -188,7 +189,7 @@ private static String fixedGetPropertyValueName(int propEnum, int valueEnum, int
newValue = regularize(newValue, true);
if (propEnum == UProperty.BLOCK && newValue.equals("Sutton_Sign_Writing")) {
newValue = "Sutton_SignWriting";
}
}
fixSkeleton.put(value, newValue);
}
return newValue;
Expand All @@ -197,7 +198,7 @@ private static String fixedGetPropertyValueName(int propEnum, int valueEnum, int
public List _getNameAliases(List result) {
if (result == null) result = new ArrayList();
// String alias = String_Extras.get(propEnum);
// if (alias == null)
// if (alias == null)
String alias = Binary_Extras.get(propEnum);
if (alias != null) {
addUnique(alias, result);
Expand Down Expand Up @@ -232,7 +233,7 @@ public String getFixedPropertyName(int propName, int nameChoice) {
}
}
}

public UnicodeSet getSet(PatternMatcher matcher, UnicodeSet result) {
result = super.getSet(matcher, result);
if (propEnum == UProperty.GENERAL_CATEGORY) {
Expand All @@ -246,7 +247,7 @@ public UnicodeSet getSet(PatternMatcher matcher, UnicodeSet result) {
return result;
}


static Map<String,R2<String,UnicodeSet>> SPECIAL_GC = new LinkedHashMap<String,R2<String,UnicodeSet>>();
static {
String[][] extras = {
Expand All @@ -263,7 +264,7 @@ public UnicodeSet getSet(PatternMatcher matcher, UnicodeSet result) {
SPECIAL_GC.put(extra[0], (R2<String, UnicodeSet>) Row.of(extra[1], new UnicodeSet(extra[2]).freeze()).freeze());
}
}

public List _getAvailableValues(List result) {
if (result == null) result = new ArrayList();
if (propEnum == UProperty.AGE) {
Expand Down Expand Up @@ -364,23 +365,23 @@ private void addAliases(int propId, String valueAlias, List result) {
*/
private int internalGetPropertyType(int prop) {
switch(prop) {
case UProperty.AGE:
case UProperty.BLOCK:
case UProperty.SCRIPT:
case UProperty.AGE:
case UProperty.BLOCK:
case UProperty.SCRIPT:
return UnicodeProperty.CATALOG;
case UProperty.ISO_COMMENT:
case UProperty.NAME:
case UProperty.UNICODE_1_NAME:
case UProperty.UNICODE_1_NAME:
return UnicodeProperty.MISC;
case UProperty.BIDI_MIRRORING_GLYPH:
case UProperty.CASE_FOLDING:
case UProperty.LOWERCASE_MAPPING:
case UProperty.SIMPLE_CASE_FOLDING:
case UProperty.SIMPLE_CASE_FOLDING:
case UProperty.SIMPLE_LOWERCASE_MAPPING:
case UProperty.SIMPLE_TITLECASE_MAPPING:
case UProperty.SIMPLE_TITLECASE_MAPPING:
case UProperty.SIMPLE_UPPERCASE_MAPPING:
case UProperty.TITLECASE_MAPPING:
case UProperty.UPPERCASE_MAPPING:
case UProperty.TITLECASE_MAPPING:
case UProperty.UPPERCASE_MAPPING:
return UnicodeProperty.EXTENDED_STRING;
}
if (prop < UProperty.BINARY_START) return UnicodeProperty.UNKNOWN;
Expand Down Expand Up @@ -518,7 +519,7 @@ public UnicodeProperty getInternalProperty(String propertyAlias) {
/* (non-Javadoc)
* @see com.ibm.icu.dev.util.UnicodePropertySource#getProperty(java.lang.String)
*/
// TODO file bug on getPropertyValueName for Canonical_Combining_Class
// TODO file bug on getPropertyValueName for Canonical_Combining_Class

public static class Names {
private String[] names;
Expand Down

0 comments on commit 858a461

Please sign in to comment.