Cldr Collation version 1.0.0
This is a major release that replaces the previous NIF-only implementation with a
complete pure-Elixir implementation of the Unicode Collation Algorithm (UCA) as
extended by CLDR. The optional NIF backend is retained for high-performance use cases.
Breaking changes
-
The main module is now
Cldr.Collation(wasCldr.Collator). -
Cldr.Collation.compare/3returns:lt | :eq | :gt(was-1 | 0 | 1). -
Module-based comparators are now
Cldr.Collation.SensitiveandCldr.Collation.Insensitive(wereCldr.Collator.SensitiveandCldr.Collator.Insensitive).
Enhancements
-
Implement the full Unicode Collation Algorithm in pure Elixir, removing the hard requirement on ICU system libraries.
-
Support all BCP47 -u- extension collation keys: strength, alternate, backwards, normalization, case_level, case_first, numeric, reorder, and max_variable.
-
Add locale-specific tailoring for Danish, German (phonebook), Spanish, Swedish, Finnish, Norwegian, Polish, Croatian, and Turkish.
-
Add CJK radical-stroke ordering via
Cldr.Collation.Han. -
Add fast Latin lookup path for codepoints U+0000..U+017F.
-
Add script reordering support (
reorderoption). -
Add convenience options:
ignore_accents,ignore_case,ignore_punctuation, andcasingfor compatibility with the previousex_cldr_collationAPI. -
Add
Cldr.Collation.sort/2for sorting string lists. -
Add
Cldr.Collation.sort_key/2for generating binary sort keys. -
Support
Cldr.LanguageTagstructs as the:localeoption whenex_cldris available.