Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/baranwang/pinyin
Node.js 汉字转拼音
https://github.com/baranwang/pinyin
chinese npm pinyin
Last synced: 4 months ago
JSON representation
Node.js 汉字转拼音
- Host: GitHub
- URL: https://github.com/baranwang/pinyin
- Owner: baranwang
- Created: 2021-11-27T14:39:47.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-11-01T00:17:02.000Z (4 months ago)
- Last Synced: 2024-11-01T01:19:21.891Z (4 months ago)
- Topics: chinese, npm, pinyin
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@baranwang/pinyin
- Size: 698 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pinyin
[](https://www.npmjs.com/package/@baranwang/pinyin)
[](https://github.com/baranwang/pinyin/actions/workflows/npm-publish.yml)
Node.js 汉字转拼音,支持多音字,自动分词
## 安装
```shell
npm i @baranwang/pinyin
# or
yarn add @baranwang/pinyin
# or
pnpm add @baranwang/pinyin
```## 使用
```javascript
const { Pinyin } = require("@baranwang/pinyin");const pinyin = new Pinyin();
pinyin.get("你好"); // [["nǐ hǎo"]]
```## 关于
### 词典来源
[mozillazg/pinyin-data](https://github.com/mozillazg/pinyin-data.git)[mozillazg/phrase-pinyin-data](https://github.com/mozillazg/phrase-pinyin-data.git)
### 分词
[novel-segment](https://github.com/bluelovers/ws-segment/tree/master/packages/novel-segment)