{"id":28430972,"url":"https://github.com/elixir-cldr/cldr_collation","last_synced_at":"2025-12-11T23:52:05.241Z","repository":{"id":54205831,"uuid":"171166997","full_name":"elixir-cldr/cldr_collation","owner":"elixir-cldr","description":"CLDR Collation","archived":false,"fork":false,"pushed_at":"2024-10-19T07:47:55.000Z","size":10209,"stargazers_count":4,"open_issues_count":5,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-05T14:39:41.575Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elixir-cldr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-02-17T20:11:58.000Z","updated_at":"2024-10-19T07:47:58.000Z","dependencies_parsed_at":"2023-02-07T06:31:55.402Z","dependency_job_id":"a98b53d5-1ee9-4551-b2c5-6b81dea1e6d6","html_url":"https://github.com/elixir-cldr/cldr_collation","commit_stats":null,"previous_names":["kipcole9/cldr_collation"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/elixir-cldr/cldr_collation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cldr%2Fcldr_collation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cldr%2Fcldr_collation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cldr%2Fcldr_collation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cldr%2Fcldr_collation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elixir-cldr","download_url":"https://codeload.github.com/elixir-cldr/cldr_collation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cldr%2Fcldr_collation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263587935,"owners_count":23484831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-05T14:30:41.898Z","updated_at":"2025-12-11T23:52:05.198Z","avatar_url":"https://github.com/elixir-cldr.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cldr Collation\n\nA NIF-based Unicode collator based upon the Unicode library `libicu4c`. Builds upon the\nerlang library [erlang-ucol](https://github.com/barrel-db/erlang-ucol) by Benoit Chesneau \u003cbenoitc@e-engura.org\u003e and Nicolas Dufour \u003cnrdufour@gmail.com\u003e\n\nThis initial version uses only the \"root\" locale collator which is the [CLDR DUCET collator](http://userguide.icu-project.org/collation).\n\n## Installation\n\n`ex_cldr_collation` depends upon [libicu](https://unicode-org.github.io/icu/userguide/icu/) to provide the underlying collator. There are two required components:\n\n* At *build* time (compilation), the `libicu` development headers are are required. On MacOS these headers are provided as part of the library. For Linux systems the package typically called `libicu-dev` is required.\n\n* At *runtime* the `libicu` library is required. On MacOS and Ubuntu this library is delivered as part of the OS. For Alpine and Debian the `icu` package needs to be installed.\n\n### Installation on MacOS\n\nOn MacOS, the relevant headers are included in `ex_cldr_collation` and no additional installation is required. The build process will link to the MacOX native `icucore` library.\n\nHowever it is also possible to use another installation of `libicu` if, for some reason, the native installation is not sufficiently up-to-date.  An installed `icu4c` will take precedence over the native `icucore` library. For example, the following will install `icu4c` (which includes `libicu`), and link it into the standard search path. When compiling, this installation will take precendence.\n\n```bash\n% brew install icu4c\n% brew link icu4c\n# Remove any old build of the NIF that may have been linked to the native icucore lib\n% rm ./deps/ex_cldr_collation/priv.ucol.so\n% mix deps.compile ex_cldr_collation\n```\n\n### Installation on Linux\n\nOn Linux systems, `libicu-dev`, `libicu` and `pkg-conf` must be installed and well as basic development tools for the build process.\n\n```bash\n# For Ubuntu\n# pkg-config and libicu are required for compiling the NIF\n# assumes libicu is already installed which is normal on Ubuntu\n$ sudo apt-get install pkgconf libicu-dev\n\n# For Debian\n# pkg-config and icu-dev are required when compiling the NIF\n# libicu is required at runtime\n# Debian Bullseye\n$ sudo apt install pkgconf libicu-dev libicu67\n# Debian Bookworm\n$ sudo apt install pkgconf libicu-dev libicu72\n\n# For Alpine\n# pkg-config and icu-dev are required when compiling the NIF\n# icu is required at runtime\n$ apk add pkgconf icu-dev icu\n\n# Then check that the libicu package dependencies\n# can be resolved\n$ pkg-config --libs icu-uc icu-io\n-licuio -licui18n -licuuc -licudata\n```\n\n### Installing ex_cldr_collation\nThe package can then be installed by adding `cldr_collation` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:ex_cldr_collation, \"~\u003e 0.7.0\"}\n  ]\nend\n```\n\n## Examples\n```elixir\n  # Sorting using Cldr.Collator.sort/2\n  iex\u003e Cldr.Collation.sort([\"á\", \"b\", \"A\"], casing: :sensitive)\n  [\"A\", \"á\", \"b\"]\n\n  iex\u003e Cldr.Collation.sort([\"á\", \"b\", \"A\"], casing: :insensitive)\n  [\"á\", \"A\", \"b\"]\n\n  # Comparing strings\n  iex\u003e Cldr.Collation.compare(\"a\", \"A\", casing: :insensitive)\n  :eq\n\n  iex\u003e Cldr.Collation.compare(\"a\", \"A\", casing: :sensitive)\n  :lt\n\n  # Using Elixir 1.10 Enum.sort\n  # Cldr.Collation.Sensitive, Cldr.Collation.Insensitive\n  # comparise modules are provided\n\n  iex\u003e Enum.sort([\"AAAA\", \"AAAa\"], Cldr.Collation.Insensitive)\n  [\"AAAA\", \"AAAa\"]\n\n  iex\u003e Enum.sort([\"AAAA\", \"AAAa\"], Cldr.Collation.Sensitive)\n  [\"AAAa\", \"AAAA\"]\n```\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-cldr%2Fcldr_collation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felixir-cldr%2Fcldr_collation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-cldr%2Fcldr_collation/lists"}