Skip to content

Releases: elixir-cldr/cldr_collation

Cldr Collation version 1.1.0

11 May 05:27

Choose a tag to compare

Bug Fixes

  • Cldr.Collation.Insensitive.compare/2 now accepts any term, falling back to Erlang term order when either argument is non-binary so it can be used safely as a comparator with Enum.sort_by/3 and multi-key sort functions. Cldr.Collation.compare/3 and sort_key/2 now raise a clear ArgumentError (instead of crashing in internal lookup) when given non-binary input. Thanks to @tjchambers for the report. Closes #20.

Cldr Collation version 1.0.0

11 May 05:28

Choose a tag to compare

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 (was Cldr.Collator).

  • Cldr.Collation.compare/3 returns :lt | :eq | :gt (was -1 | 0 | 1).

  • Module-based comparators are now Cldr.Collation.Sensitive and Cldr.Collation.Insensitive (were Cldr.Collator.Sensitive and Cldr.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 (reorder option).

  • Add convenience options: ignore_accents, ignore_case, ignore_punctuation, and casing for compatibility with the previous ex_cldr_collation API.

  • Add Cldr.Collation.sort/2 for sorting string lists.

  • Add Cldr.Collation.sort_key/2 for generating binary sort keys.

  • Support Cldr.LanguageTag structs as the :locale option when ex_cldr is available.

Cldr Collation version 0.7.5

28 Sep 22:06

Choose a tag to compare

Bug fixes

  • Remove deprecated linker option -undefined suppress in favour of -undefined dynamic_lookup on MacOS.

  • Update README to illustrate how an installed libicu in the search path will take precendence over user the native icucore library.

Cldr Collation version 0.7.4

24 Sep 20:56

Choose a tag to compare

Bug fixes

  • Fix Makefile for Darwin (MacOS) when running in devenv. Thanks to @serpent213 for the issue. Closes #14.

Cldr Collation version 0.7.3

27 May 22:12

Choose a tag to compare

Bug fixes

  • Fix compiler warnings for Elixir 1.17.

Cldr Collation version 0.7.2

27 Feb 21:16

Choose a tag to compare

Bug fixes

  • Makes the Makefile more resilient by exiting if pkg-config isn't installed and therefore ICU_LIBS is empty. Previously this would fail silently and an unclear runtime error would be reported.

  • Improved the error message if the NIF can't be loaded. Thanks to @linusdm. Closes #8.

Cldr Collation version 0.7.1

23 Feb 20:35

Choose a tag to compare

Bug fixes

  • Add binary guards to Cldr.Collation.compare/3.

Cldr Collation version 0.7.0

04 Jan 19:41

Choose a tag to compare

Bug fixes

  • Fix the .so path for the NIF at load time, not compile time. Thanks to @sergiorjsd for the report. Closes #3.

  • Fix buidling on ARM-based Mac models

Cldr Collation version 0.6.0

03 Jul 01:12

Choose a tag to compare

Bug fixes

  • Load the nif from a path relative to :code.priv_dir/1.

Cldr Collation version 0.5.0

23 Jun 11:21

Choose a tag to compare

Bug fixes

  • Correctly reference the ucol.so file when loading at startup

Enhancements

  • Adds Cldr.Collator.sort/2

  • Adds documentation for Cldr.Collator.compare/3