All Projects → zhujun24 → Chinese To Pinyin

zhujun24 / Chinese To Pinyin

Licence: mit
一个将中文翻译成拼音的库

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Chinese To Pinyin

Swiftyopencc
Swift port of OpenCC for conversion between Traditional and Simplified Chinese
Stars: ✭ 129 (-35.18%)
Mutual labels:  chinese-translation
React Native Search List
A searchable ListView which supports Chinese PinYin and alphabetical index.
Stars: ✭ 152 (-23.62%)
Mutual labels:  pinyin
Alfredmagic
一个面向效率提升的中文Workflow
Stars: ✭ 178 (-10.55%)
Mutual labels:  chinese-translation
Gpy
Go 语言汉字转拼音工具
Stars: ✭ 136 (-31.66%)
Mutual labels:  pinyin
Swiftui Tutorials
A code example and translation project of SwiftUI. / 一个 SwiftUI 的示例、翻译的教程项目。
Stars: ✭ 1,992 (+901.01%)
Mutual labels:  chinese-translation
G2pc
g2pC: A Context-aware Grapheme-to-Phoneme Conversion module for Chinese
Stars: ✭ 155 (-22.11%)
Mutual labels:  pinyin
Awesome Macos Command Line Zh
用你的 macOS 终端搞事情。(Use your macOS terminal shell to do awesome things. )
Stars: ✭ 117 (-41.21%)
Mutual labels:  chinese-translation
Elinux
嵌入式 Linux 知识库 (elinux.org) 中文翻译计划;本项目发起人发布了《360° 剖析 Linux ELF》视频课程,欢迎订阅:https://www.cctalk.com/m/group/88089283
Stars: ✭ 193 (-3.02%)
Mutual labels:  chinese-translation
Tys Zh Translation
A Chinese translation of "teach-yourself-scheme-in-fixnum-days"
Stars: ✭ 148 (-25.63%)
Mutual labels:  chinese-translation
Elasticsearch Analysis Pinyin
This Pinyin Analysis plugin is used to do conversion between Chinese characters and Pinyin.
Stars: ✭ 2,215 (+1013.07%)
Mutual labels:  pinyin
Logback Chinese Manual
logback 中文手册/文档。
Stars: ✭ 138 (-30.65%)
Mutual labels:  chinese-translation
Icopy Site.github.io
icopy.site github mirror
Stars: ✭ 142 (-28.64%)
Mutual labels:  chinese-translation
Linux Doc
Linux Documentation 中文翻译计划
Stars: ✭ 163 (-18.09%)
Mutual labels:  chinese-translation
Redis
《Redis Command Reference》全文的中文翻译版。
Stars: ✭ 1,700 (+754.27%)
Mutual labels:  chinese-translation
Docs Chinese
Fastify 中文文档
Stars: ✭ 183 (-8.04%)
Mutual labels:  chinese-translation
Cs50 Study Group
CS50 Study Group & Subtitle Translation Initiative
Stars: ✭ 117 (-41.21%)
Mutual labels:  chinese-translation
Pcl Cn
Practical Common Lisp (中英文对照版) - for Chinese only
Stars: ✭ 155 (-22.11%)
Mutual labels:  chinese-translation
Guido blog translation
翻译 Guido 的解析器系列文章
Stars: ✭ 200 (+0.5%)
Mutual labels:  chinese-translation
Toolgood.words
一款高性能敏感词(非法词/脏字)检测过滤组件,附带繁体简体互换,支持全角半角互换,汉字转拼音,模糊搜索等功能。
Stars: ✭ 2,785 (+1299.5%)
Mutual labels:  pinyin
Netty 4 User Guide
Chinese translation of Netty 4.x User Guide. 中文翻译《Netty 4.x 用户指南》
Stars: ✭ 2,061 (+935.68%)
Mutual labels:  chinese-translation

Chinese-to-Pinyin - 一个将中文翻译成拼音的库,支持多音字

npm package

Build Status Coverage Status Known Vulnerabilities FOSSA Status npm package

NPM downloads Dependency Status Dependency Status Standard - JavaScript Style Guide

安装

npm install chinese-to-pinyin --save

开发

npm start

测试

npm test

编译

npm run build

使用

var pinyin = require("chinese-to-pinyin")
pinyin('中文语句')

示例

pinyin('今天天气真好') // jīn tiān tiān qì zhēn hǎo

支持多音字

pinyin('蚌埠六安哪吒都灵') // bèng bù lù ān né zhā dū líng

略去声调

pinyin('今天天气真好', {removeTone: true}) // jin tian tian qi zhen hao

声调转数字

pinyin('今天天气真好', {toneToNumber: true}) // jin1 tian1 tian1 qi4 zhen1 hao3

声调转数字,只输出音调

pinyin('今天天气真好', {toneToNumberOnly: true}) // 1 1 1 4 1 3

移除拼音间的空格

pinyin('今天天气真好', {removeSpace: true}) // jīntiāntiānqìzhēnhǎo

保留未翻译的非中文字符

pinyin('1今天天气dd dd真e好fff', { keepRest: true }) // 1jīn tiān tiān qìdd ddzhēnehǎofff

获取中文首字母

pinyin('今天天气真好', { firstCharacter: true }) // j t t q z h
// 获取中文首字母时,保留未翻译的非中文字符
pinyin('1今2天3天4气5真6好aaa', { keepRest: true, firstCharacter: true }) // 1j2t3t4q5z6haaa
// 获取中文首字母时,不保留未翻译的非中文字符
pinyin('1今2天3天4气5真6好aaa', { firstCharacter: true }) // j t t q z h
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].