unicode-org / unicodetools

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

try to move getCollator(type) from WriteCollationData to UCA #793

Open markusicu opened 3 months ago

markusicu commented 3 months ago

If you want a DUCET collator, you can get it from class UCA. But you can also get a cached version from WriteCollationData.

If you want a CLDR collator, you need to call getCollator(type) in class WriteCollationData. That code works with class UCA. In particular, when we were still reordering characters for CLDR (before PR #762), the Remap class for doing so was in class UCA.

This seems misplaced, like an unnecessary back-and-forth. It seems like getCollator(type) should be in class UCA, and WriteCollationData should focus on, well, writing collation data.

A possible alternative is to create a separate class for making a CLDR collator, but there does not seem to be enough special code that we would need that.

So, try to move getCollator(type) from class WriteCollationData to class UCA.

@macchiati FYI

macchiati commented 3 months ago

Makes sense.

On Wed, May 1, 2024 at 12:52 PM Markus Scherer @.***> wrote:

If you want a DUCET collator, you can get it from class UCA. But you can also get a cached version from WriteCollationData.

If you want a CLDR collator, you need to call getCollator(type) in class WriteCollationData. That code works with class UCA. In particular, when we were still reordering characters for CLDR, the Remap class for doing so was in class UCA.

This seems misplaced, like an unnecessary back-and-forth. It seems like getCollator(type) should be in class UCA, and WriteCollationData should focus on, well, writing collation data.

A possible alternative is to create a separate class for making a CLDR collator, but there does not seem to be enough special code that we would need that.

So, try to move getCollator(type) from class WriteCollationData to class UCA.

@macchiati https://github.com/macchiati FYI

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