https://github.com/pepebecker/pinyin-utils
Some useful utilities to transform Pinyin syllables.
https://github.com/pepebecker/pinyin-utils
chinese hacktoberfest mandarin pinyin tone utils
Last synced: 5 months ago
JSON representation
Some useful utilities to transform Pinyin syllables.
- Host: GitHub
- URL: https://github.com/pepebecker/pinyin-utils
- Owner: pepebecker
- License: isc
- Created: 2017-04-18T22:41:05.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-11-25T13:08:40.000Z (almost 5 years ago)
- Last Synced: 2025-04-22T09:21:40.590Z (6 months ago)
- Topics: chinese, hacktoberfest, mandarin, pinyin, tone, utils
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/pinyin-utils
- Size: 65.4 KB
- Stars: 27
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pinyin Utils
[](https://www.npmjs.com/package/pinyin-utils)
[](https://travis-ci.org/pepebecker/pinyin-utils)
[](https://david-dm.org/pepebecker/pinyin-utils)
[](https://david-dm.org/pepebecker/pinyin-utils#info=devDependencies)
[](https://choosealicense.com/licenses/isc/)## Install
```shell
npm install pinyin-utils
```## Usage
```js
import * as utils from 'pinyin-utils'
console.log(utils.getToneNumber('shì')) // 4
console.log(utils.getToneNumber('shi4')) // 4
console.log(utils.removeTone('wǒ')) // wo
console.log(utils.removeTone('wo3')) // wo
console.log(utils.markToNumber('lǜ')) // lü4
console.log(utils.numberToMark('lü4')) // lǜ
```## Related
- [`pinyin-split`](https://github.com/pepebecker/pinyin-split)
- [`find-hanzi`](https://github.com/pepebecker/find-hanzi)
- [`hsk-words`](https://github.com/pepebecker/hsk-words)
- [`cedict`](https://github.com/pepebecker/cedict)
- [`mdbg`](https://github.com/pepebecker/mdbg)
- [`pinyin-or-hanzi`](https://github.com/pepebecker/pinyin-or-hanzi)
- [`hanzi-to-pinyin`](https://github.com/pepebecker/hanzi-to-pinyin)
- [`pinyin-convert`](https://github.com/pepebecker/pinyin-convert)
- [`pinyin-rest`](https://github.com/pepebecker/pinyin-rest)
- [`pinyin-api`](https://github.com/pepebecker/pinyin-api)
- [`pinyin-bot-core`](https://github.com/pepebecker/pinyin-bot-core)
- [`pinyin-telegram`](https://github.com/pepebecker/pinyin-telegram)
- [`pinyin-messenger`](https://github.com/pepebecker/pinyin-messenger)
- [`pinyin-line`](https://github.com/pepebecker/pinyin-line)
- [`pinyin-chrome`](https://github.com/pepebecker/pinyin-chrome)
- [`pinyin-cli`](https://github.com/pepebecker/pinyin-cli)
- [`hanzi-cli`](https://github.com/pepebecker/hanzi-cli)## Contributing
If you **have a question**, **found a bug** or want to **propose a feature**, have a look at [the issues page](https://github.com/pepebecker/pinyin-utils/issues).