{"id":13648570,"url":"https://github.com/Berrysoft/language-matcher","last_synced_at":"2025-04-22T11:32:47.668Z","repository":{"id":58976293,"uuid":"534863015","full_name":"Berrysoft/language-matcher","owner":"Berrysoft","description":"A language matcher with CLDR.","archived":false,"fork":false,"pushed_at":"2023-02-28T06:05:54.000Z","size":22,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T17:27:41.199Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Berrysoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-09-10T01:58:22.000Z","updated_at":"2023-05-12T00:12:46.000Z","dependencies_parsed_at":"2024-01-14T10:59:27.494Z","dependency_job_id":null,"html_url":"https://github.com/Berrysoft/language-matcher","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"8427286f16062d62e16f1854e87ab387a418335f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Berrysoft%2Flanguage-matcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Berrysoft%2Flanguage-matcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Berrysoft%2Flanguage-matcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Berrysoft%2Flanguage-matcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Berrysoft","download_url":"https://codeload.github.com/Berrysoft/language-matcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250232391,"owners_count":21396632,"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":"2024-08-02T01:04:21.487Z","updated_at":"2025-04-22T11:32:47.379Z","avatar_url":"https://github.com/Berrysoft.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# language-matcher\n\nThere's no language matcher in [`icu4x`](https://github.com/unicode-org/icu4x).\nAnd, if you have noticed, the language matching data in the JSON data of CLDR is broken.\n\nThis is a [language matcher](https://www.unicode.org/reports/tr35/tr35.html#EnhancedLanguageMatching) based on the XML data of CLDR.\nThe distance value is multiplied by 10 to show the difference by paradigm locales.\n\n``` rust\nuse icu_locid::langid;\nuse language_matcher::LanguageMatcher;\n\nlet matcher = LanguageMatcher::new();\n\nassert_eq!(matcher.distance(langid!(\"zh-CN\"), langid!(\"zh-Hans\")), 0);\nassert_eq!(matcher.distance(langid!(\"zh-HK\"), langid!(\"zh-MO\")), 40);\n\nlet accepts = [\n    langid!(\"en\"),\n    langid!(\"ja\"),\n    langid!(\"zh-Hans\"),\n    langid!(\"zh-Hant\"),\n];\nassert_eq!(\n    matcher.matches(langid!(\"zh-CN\"), \u0026accepts),\n    Some((\u0026langid!(\"zh-Hans\"), 0))\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBerrysoft%2Flanguage-matcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBerrysoft%2Flanguage-matcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBerrysoft%2Flanguage-matcher/lists"}