{"id":31901033,"url":"https://github.com/berrysoft/language-matcher","last_synced_at":"2025-10-13T12:52:02.681Z","repository":{"id":58976293,"uuid":"534863015","full_name":"Berrysoft/language-matcher","owner":"Berrysoft","description":"A language matcher with CLDR.","archived":false,"fork":false,"pushed_at":"2025-05-21T03:02:44.000Z","size":26,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-06T01:54:38.848Z","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":"2025-05-21T03:02:48.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,"purl":"pkg:github/Berrysoft/language-matcher","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","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Berrysoft%2Flanguage-matcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279015087,"owners_count":26085644,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-13T12:52:00.684Z","updated_at":"2025-10-13T12:52:02.673Z","avatar_url":"https://github.com/Berrysoft.png","language":"Rust","funding_links":[],"categories":[],"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"}