{"id":23391297,"url":"https://github.com/bdon/hanzi2reading","last_synced_at":"2026-02-19T20:31:25.024Z","repository":{"id":57260729,"uuid":"240378161","full_name":"bdon/hanzi2reading","owner":"bdon","description":"Library for Standard Chinese pronunciation with swappable dictionary backends","archived":false,"fork":false,"pushed_at":"2022-01-11T12:25:57.000Z","size":1809,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-13T11:25:39.307Z","etag":null,"topics":["chinese","pinyin","zhuyin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bdon.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":"2020-02-13T22:22:59.000Z","updated_at":"2024-11-22T02:41:46.000Z","dependencies_parsed_at":"2022-08-25T02:11:35.946Z","dependency_job_id":null,"html_url":"https://github.com/bdon/hanzi2reading","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bdon/hanzi2reading","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdon%2Fhanzi2reading","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdon%2Fhanzi2reading/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdon%2Fhanzi2reading/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdon%2Fhanzi2reading/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bdon","download_url":"https://codeload.github.com/bdon/hanzi2reading/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdon%2Fhanzi2reading/sbom","scorecard":{"id":229150,"data":{"date":"2025-08-11","repo":{"name":"github.com/bdon/hanzi2reading","commit":"2641c8658f168c42aaefd72d0d8aa7265aa5cdea"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 2-Clause \"Simplified\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}}]},"last_synced_at":"2025-08-17T04:30:05.861Z","repository_id":57260729,"created_at":"2025-08-17T04:30:05.861Z","updated_at":"2025-08-17T04:30:05.861Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29630829,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T18:02:07.722Z","status":"ssl_error","status_checked_at":"2026-02-19T18:01:46.144Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["chinese","pinyin","zhuyin"],"created_at":"2024-12-22T04:14:44.771Z","updated_at":"2026-02-19T20:31:24.987Z","avatar_url":"https://github.com/bdon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hanzi2reading\n\nA library for transcribing strings of Chinese characters to their readings in Mandarin.\n\nAn example JavaScript application: http://bdon.org/hanzireader/\n\n* Disambiguates multiple-reading characters based on a dictionary.\n* Defines a binary format for dictionaries that can be loaded at runtime.\n  * The dictionary format is designed to be as compact as possible.\n  * Dictonaries are agnostic to Traditional/Simplified script and transliteration format, and store pronunciations as [2-byte syllable sequences](#syllable-format) based on Zhuyin.\n  * A typical dictionary CC-CEDICT in this format is around 700 kB, or less than 300 kB Brotli-compressed, meaning it is practical to load the entire dictionary once over the web and then perform transcription without any network communication.\n* The library and dictionary can be shared across multiple programming languages. Python and JavaScript are supported right now.\n\n## Installation\n\nJavascript: `npm install hanzi2reading`\nPython: `pip install hanzi2reading`\n\n## Dictionaries\n\n* CC-CEDICT. Licensed CC-BY-SA.\n* Moedict. Licensed CC-BY-ND. https://github.com/g0v/moedict-data/blob/master/README.md\n* Unihan database, which contains 1-grams only. Licensed under Unicode License.\n\n## Limitations\n\n* This library only does dictionary-based lookups of character sequences. It does not attempt to disambiguate readings based on parts of speech, which is necessary for transcribing complete sentences. \n* Word segmentation and proper nouns for formatted Pinyin is not supported, but may be in the future.\n\n## Syllable Format\n\nPart | Bits\n--- | ---\nInitial | 5\nMedial | 2\nFinal | 4\nTone | 3\nEr | 1\n\nA syllable is serialized in a dictionary as a 2-byte sequence (little-endian). When loaded into a programming runtime, a syllable is a tuple or array of five integers. Example: the syllable kiāng ㄎㄧㄤ corresponds to the array [10,1,11,1,0] or the byte sequence `0b 1011 0010 0010 1001`\n\n## Notes\n* https://www.unicode.org/reports/tr38/#N1019C\n* https://languagelog.ldc.upenn.edu/nll/?p=45843\n\n## Resources\n* https://github.com/mozillazg/python-pinyin (SC only, data embedded in code)\n* https://github.com/tsroten/dragonmapper (data is in large CSV files, Python only)\n* https://github.com/g0v/moedict-data\n* https://cc-cedict.org/editor/editor.php\n* https://chrome.google.com/webstore/detail/zhongwen-chinese-english/kkmlkkjojmombglmlpbpapmhcaljjkde\n* https://github.com/skishore/makemeahanzi\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdon%2Fhanzi2reading","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbdon%2Fhanzi2reading","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdon%2Fhanzi2reading/lists"}