{"id":26804509,"url":"https://github.com/djtb/hatsuon","last_synced_at":"2025-09-15T12:33:01.868Z","repository":{"id":57141766,"uuid":"128286027","full_name":"DJTB/hatsuon","owner":"DJTB","description":"Japanese pitch accent utils","archived":false,"fork":false,"pushed_at":"2023-03-07T15:46:00.000Z","size":2950,"stargazers_count":31,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T17:43:12.297Z","etag":null,"topics":["accent","haku","japanese","mora","on","pattern","pitch","pronunciation"],"latest_commit_sha":null,"homepage":"https://djtb.github.io/hatsuon","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DJTB.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"license","code_of_conduct":"code_of_conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-06T02:03:00.000Z","updated_at":"2025-04-15T07:15:11.000Z","dependencies_parsed_at":"2024-08-22T23:14:34.382Z","dependency_job_id":"734e32d8-013d-40b5-9966-ca64e3e68c8a","html_url":"https://github.com/DJTB/hatsuon","commit_stats":{"total_commits":25,"total_committers":1,"mean_commits":25.0,"dds":0.0,"last_synced_commit":"8c09a8e091c8b8a8c1a14f68aa71cf5baac5065b"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DJTB%2Fhatsuon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DJTB%2Fhatsuon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DJTB%2Fhatsuon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DJTB%2Fhatsuon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DJTB","download_url":"https://codeload.github.com/DJTB/hatsuon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250372947,"owners_count":21419722,"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":["accent","haku","japanese","mora","on","pattern","pitch","pronunciation"],"created_at":"2025-03-29T22:17:39.170Z","updated_at":"2025-04-23T04:51:35.705Z","avatar_url":"https://github.com/DJTB.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 発音 hatsuon\n\n\u003e Japanese pitch accent tools\n\n[![npm](https://img.shields.io/npm/v/hatsuon.svg?style=flat-square)](https://www.npmjs.com/package/hatsuon)\n[![npm](https://img.shields.io/npm/dt/hatsuon.svg?style=flat-square)](https://npm-stat.com/charts.html?package=hatsuon\u0026from=2016-04-01)\n[![Travis branch](https://img.shields.io/travis/DJTB/hatsuon/master.svg?style=flat-square)](https://travis-ci.com/DJTB/hatsuon)\n[![Codecov branch](https://img.shields.io/codecov/c/github/DJTB/hatsuon/master.svg?style=flat-square)](https://codecov.io/github/DJTB/hatsuon)\n\u003cbr /\u003e\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](http://commitizen.github.io/cz-cli/)\n[![Code of Conduct](https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square)](./code_of_conduct.md)\n\n## Why?\n\nJapanese dictionaries often display the pitch accent of a word with a single number that determines where the pitch falls. This can be difficult to mentally visualize without counting through the [mora](\u003chttps://en.wikipedia.org/wiki/Mora_(linguistics)#Japanese\u003e) of the word. This library provides useful tools for generating pitch patterns which can then be easily displayed via SVG.\n\n## Installation\n\n```sh\nnpm install --save hatsuon\n```\n\n## Demo\n\n[Visualization Example](https://djtb.github.io/hatsuon)\n\n## Usage\n\n```js\nimport { hatsuon } from 'hatsuon';\n\nhatsuon({ reading: 'ちゅうがっこう', pitchNum: 3 });\n// =\u003e\n{\n  reading: 'ちゅうがっこう',\n  pitchNum: 3,\n  morae: ['ちゅ', 'う', 'が', 'っ', 'こ', 'う'],\n  // low, high, high, low, low, low, low*\n  // *following particle (は、が, の etc) pitch\n  pattern: [0, 1, 1, 0, 0, 0, 0],\n  patternName: '中高', // nakadaka\n}\n```\n\nExtra available utils (see source for documentation):\n\n```js\nimport {\n  isDigraph,\n  getMorae,\n  getMoraCount,\n  makePitchPattern,\n  getPitchPatternName,\n  getPitchNumFromPattern,\n} from 'hatsuon';\n```\n\n## Related\n\n[WanaKana](https://github.com/WaniKani/WanaKana) : Japanese romaji \u003c-\u003e kana transliteration library\n\n## Contributors\n\nThanks goes to these people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\n\u003c!-- prettier-ignore --\u003e\n| [\u003cimg src=\"https://avatars3.githubusercontent.com/u/5353151?s=100\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDuncan Bay\u003c/b\u003e\u003c/sub\u003e](https://github.com/DJTB)\u003cbr /\u003e[💻](https://github.com/DJTB/hatsuon/commits?author=DJTB \"Code\") [📖](https://github.com/DJTB/hatsuon/commits?author=DJTB \"Documentation\") [🚇](#infra-DJTB \"Infrastructure (Hosting, Build-Tools, etc)\") [🎨](#design-DJTB \"Design\") |\n| :---: |\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!\n\n## License\n\nMIT \u0026copy; [Duncan Bay](https://github.com/DJTB)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjtb%2Fhatsuon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdjtb%2Fhatsuon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjtb%2Fhatsuon/lists"}