From 858a4612a0b37bab36dcb6db62e5a4f901562e8e Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 20 Jul 2021 16:20:36 -0500 Subject: [PATCH] Fix Extended_Pictographic in UnicodeProperty for JSP For #97 --- .../org/unicode/jsp/ICUPropertyFactory.java | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/UnicodeJsps/src/main/java/org/unicode/jsp/ICUPropertyFactory.java b/UnicodeJsps/src/main/java/org/unicode/jsp/ICUPropertyFactory.java index f17464980..47be56184 100644 --- a/UnicodeJsps/src/main/java/org/unicode/jsp/ICUPropertyFactory.java +++ b/UnicodeJsps/src/main/java/org/unicode/jsp/ICUPropertyFactory.java @@ -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); } @@ -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 @@ -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 ); @@ -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; @@ -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); @@ -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) { @@ -246,7 +247,7 @@ public UnicodeSet getSet(PatternMatcher matcher, UnicodeSet result) { return result; } - + static Map> SPECIAL_GC = new LinkedHashMap>(); static { String[][] extras = { @@ -263,7 +264,7 @@ public UnicodeSet getSet(PatternMatcher matcher, UnicodeSet result) { SPECIAL_GC.put(extra[0], (R2) 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) { @@ -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; @@ -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;