{"id":16064394,"url":"https://github.com/yeslogic/unicode-joining-type","last_synced_at":"2025-03-16T08:32:07.970Z","repository":{"id":36481444,"uuid":"227009869","full_name":"yeslogic/unicode-joining-type","owner":"yeslogic","description":"Fast lookup of the Unicode Joining Type property for `char` in Rust.","archived":false,"fork":false,"pushed_at":"2024-10-30T01:56:53.000Z","size":65,"stargazers_count":6,"open_issues_count":1,"forks_count":3,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-10T14:42:16.033Z","etag":null,"topics":["joining-type","rust","ucd","unicode"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yeslogic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-10T02:17:28.000Z","updated_at":"2024-10-30T01:55:51.000Z","dependencies_parsed_at":"2022-08-08T15:01:45.089Z","dependency_job_id":null,"html_url":"https://github.com/yeslogic/unicode-joining-type","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeslogic%2Funicode-joining-type","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeslogic%2Funicode-joining-type/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeslogic%2Funicode-joining-type/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeslogic%2Funicode-joining-type/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yeslogic","download_url":"https://codeload.github.com/yeslogic/unicode-joining-type/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806070,"owners_count":20350775,"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":["joining-type","rust","ucd","unicode"],"created_at":"2024-10-09T05:06:57.468Z","updated_at":"2025-03-16T08:32:07.956Z","avatar_url":"https://github.com/yeslogic.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"unicode-joining-type\n====================\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/yeslogic/unicode-joining-type/actions/workflows/ci.yml\"\u003e\n    \u003cimg src=\"https://github.com/yeslogic/unicode-joining-type/actions/workflows/ci.yml/badge.svg\" alt=\"Build Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://docs.rs/unicode-joining-type\"\u003e\n    \u003cimg src=\"https://docs.rs/unicode-joining-type/badge.svg\" alt=\"Documentation\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://crates.io/crates/unicode-joining-type\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/v/unicode-joining-type.svg\" alt=\"Version\"\u003e\u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/unicode-16.0-informational\" alt=\"Unicode Version\"\u003e\n  \u003ca href=\"https://github.com/yeslogic/unicode-joining-type/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/l/unicode-joining-type.svg\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n\nFast lookup of the Unicode Joining Type and Joining Group properties for `char`\nin Rust using Unicode 16.0 data. This crate is no-std compatible.\n\nUsage\n-----\n\n```rust\nuse unicode_joining_type::{get_joining_type, JoiningType};\nuse unicode_joining_type::{get_joining_group, JoiningGroup};\n\nfn main() {\n    assert_eq!(get_joining_type('A'), JoiningType::NonJoining);\n    assert_eq!(get_joining_group('ھ'), JoiningGroup::KnottedHeh);\n}\n```\n\nPerformance \u0026 Implementation Notes\n----------------------------------\n\n[ucd-generate] is used to generate `joining_type_tables.rs` and\n`joining_group_tables.rs`. A build script (`build.rs`) compiles each of these\ninto a two level look up tables. The look up time is constant as it is just\nindexing into two arrays.\n\nThe two level approach maps a code point to a block, then to a position within\na block. The allows the second level of block to be deduplicated, saving space.\nThe code is parameterised over the block size, which must be a power of 2. The\nvalue in the build script is optimal for the data set.\n\nThis approach trades off some space for faster lookups. The joining type tables\ntake up about 26KiB, the joining group tables take up about 6.75KiB. Benchmarks\nshowed this approach to be ~5–10× faster than the typical binary search\napproach.\n\nThere is still room for further size reduction. For example, by eliminating\nrepeated block mappings at the end of the first level block array.\n\n[ucd-generate]: https://github.com/yeslogic/ucd-generate\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeslogic%2Funicode-joining-type","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeslogic%2Funicode-joining-type","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeslogic%2Funicode-joining-type/lists"}