unicode-org / unicodetools

home of unicodetools and https://util.unicode.org JSPs
https://util.unicode.org
Other
52 stars 41 forks source link

Ucdxml and TR42 #859

Open jowilco opened 5 months ago

jowilco commented 5 months ago

PR to make it easy to see what changes have been made to support UCDXML.

jowilco commented 1 month ago

Comment on June 6 is no longer valid - we're now ready for review.

jowilco commented 1 month ago

@macchiati @eggrobin @markusicu - Please can you review?

macchiati commented 2 days ago

No good reason. I think the code might predate the formal recognition as properties.

On Wed, Nov 27, 2024, 07:01 Robin Leroy @.***> wrote:

@.**** commented on this pull request.

In unicodetools/src/main/java/org/unicode/xml/AttributeResolver.java https://github.com/unicode-org/unicodetools/pull/859#discussion_r1860820160 :

  • case Script:
  • return map_script.get(codepoint).getShortName();
  • case Script_Extensions:
  • StringBuilder extensionBuilder = new StringBuilder();
  • String[] extensions = map_script_extensions.get(codepoint).split("\|", 0);
  • for (String extension : extensions) {
  • extensionBuilder.append(
  • UcdPropertyValues.Script_Values.valueOf(extension)
  • .getShortName());
  • extensionBuilder.append(" ");
  • }
  • return extensionBuilder.toString().trim();
  • default:
  • throw new RuntimeException("Missing Catalog case");
  • }
  • case Enumerated:

This (and the associated pile of UnicodeMaps) seems like it is going to be a bit annoying to maintain as we add properties. Is there a reason why you are not doing something like

final UnicodeProperty property = indexUnicodeProperties.getProperty(prop);final List valueAliases = property.getValueAliases(property.getValue(codepoint));return valueAliases.size() == 1 ? valueAliases.get(0) : valueAliases.get(1);

for most of them (special-casing Decomposition_Type etc. as needed)?

— Reply to this email directly, view it on GitHub https://github.com/unicode-org/unicodetools/pull/859#pullrequestreview-2465280738, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJLEMDD3JBHAYCDTBHLLX32CXNFDAVCNFSM6AAAAABI5USRGKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDINRVGI4DANZTHA . You are receiving this because you were mentioned.Message ID: @.***>