All Projects → Kaifun → pinyin4js

Kaifun / pinyin4js

Licence: MIT license
A opensource javascript library for converting chinese to pinyin。welcome Star : P

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to pinyin4js

chinese-rhymer
轻量中文押韵神器,100%绝对可用,傻瓜式命令行操作,秒速实现烈焰单押,闪电双押,龙卷三押以及海啸式四押,目前版本 v0.2.6。Search for rhymes for Chinese words, with 1, 2, 3 and 4 characters, released on PyPI with current version of 0.2.6.
Stars: ✭ 72 (-52.94%)
Mutual labels:  pinyin, chinese
Xpinyin
Translate Chinese hanzi to pinyin (拼音) by Python, 汉字转拼音
Stars: ✭ 709 (+363.4%)
Mutual labels:  pinyin, chinese
Python Pinyin
汉字转拼音(pypinyin)
Stars: ✭ 3,618 (+2264.71%)
Mutual labels:  pinyin, chinese
Chineseutil
PHP 中文工具包,支持汉字转拼音、拼音分词、简繁互转、数字、金额大写;QQ群:17916227
Stars: ✭ 413 (+169.93%)
Mutual labels:  pinyin, chinese
Gpy
Go 语言汉字转拼音工具
Stars: ✭ 136 (-11.11%)
Mutual labels:  pinyin, chinese
rust-pinyin
汉字转拼音
Stars: ✭ 111 (-27.45%)
Mutual labels:  pinyin, chinese
Pinyin
🇨🇳 汉字拼音 ➜ hàn zì pīn yīn
Stars: ✭ 6,047 (+3852.29%)
Mutual labels:  pinyin, chinese
syng
A free, open source, cross-platform, Chinese-To-English dictionary for desktops.
Stars: ✭ 108 (-29.41%)
Mutual labels:  pinyin, chinese
Cn sort
中文排序:按拼音/笔顺快速排序简体中文词组(百万数量级,可含中英/多音字)。如果对您有所帮助,欢迎点个star鼓励一下。
Stars: ✭ 102 (-33.33%)
Mutual labels:  pinyin, chinese
Go Pinyin
汉字转拼音
Stars: ✭ 907 (+492.81%)
Mutual labels:  pinyin, chinese
Hanbaobao
Mandarin Chinese text segmentation and mobile dictionary Android app (中文分词)
Stars: ✭ 17 (-88.89%)
Mutual labels:  pinyin, chinese
hanzi-pinyin-font
Chinese font displaying Hanzi (汉字) characters with by transliteration/pronunciation (Pīnyīn).
Stars: ✭ 79 (-48.37%)
Mutual labels:  pinyin, chinese
Somiao Pinyin
Somiao Pinyin: Train your own Chinese Input Method with Seq2seq Model 搜喵拼音输入法
Stars: ✭ 209 (+36.6%)
Mutual labels:  pinyin, chinese
pinyin data
🐼 Easy to use and portable pronunciation data for Hanzi characters.
Stars: ✭ 13 (-91.5%)
Mutual labels:  pinyin, chinese
Margoulineur2000
NFC
Stars: ✭ 24 (-84.31%)
Mutual labels:  chinese
ansj seg
ansj分词.ict的真正java实现.分词效果速度都超过开源版的ict. 中文分词,人名识别,词性标注,用户自定义词典
Stars: ✭ 6,213 (+3960.78%)
Mutual labels:  chinese
stackml-js
Machine Learning platform in-browser for creators
Stars: ✭ 34 (-77.78%)
Mutual labels:  javascript-library
Awesome-Javascript
A Curated list of Awesome JavaScript Resources
Stars: ✭ 116 (-24.18%)
Mutual labels:  javascript-library
thenewboston-js
JavaScript library for thenewboston.
Stars: ✭ 39 (-74.51%)
Mutual labels:  javascript-library
goSpider
some small project and some articles
Stars: ✭ 56 (-63.4%)
Mutual labels:  chinese

[English Document] [中文文档]

pinyin4js

codebeat badge Downloads Version License

pinyin4js是一个汉字转拼音的Javascript开源库-零依赖
A opensource javascript library for converting chinese to pinyin
Thanks for JPinyin
注:同时支持Node和浏览器使用!!!
Demo Online: https://npm.runkit.com/pinyin4js

Features

  • 零依赖

  • 词库灵活导入,打包
    可以自行调整字典,具体可以参照src/dict;所有资源调用由PinyinResource封装,可自行修改后打包

  • 准确、完善的字库
    Unicode编码从4E00-9FA5范围及3007(〇)的20903个汉字中,pinyin4js能转换除46个异体字(异体字不存在标准拼音)之外的所有汉字

  • 拼音转换速度快
    经测试,从4E00-9FA5范围的20902个汉字,pinyin4js耗时约110毫秒

  • 多拼音格式输出支持
    支持多种拼音输出格式:带音标、不带音标、数字表示音标以及拼音首字母输出格式

  • 常见多音字识别
    支持常见多音字的识别,其中包括词组、成语、地名等

  • 简繁体中文转换

  • 支持添加自定义字典
    支持添加用户自定义字典

How to use

  • INSTALL

Brower

    <script src="./dist/pinyin4js.js"></script>

Node

    npm install pinyin4js
  • USE

Node

    //[email protected] or latest
    import pinyin4js from 'pinyin4js';

    // more detail methods in test
    // WITH_TONE_NUMBER--数字代表声调,WITHOUT_TONE--不带声调,WITH_TONE_MARK--带声调

    // output: xià#mén#nǐ#hǎo#dà#shà#xià#mén
    console.log(pinyin4js.convertToPinyinString('厦门你好大厦厦门', '#', pinyin4js.WITH_TONE_MARK))

    //首字母风格
    // output: xmnhdsxm
    console.log(pinyin4js.convertToPinyinString('厦门你好大厦厦门', '', pinyin4js.FIRST_LETTER))
    // or
    console.log(pinyin4js.getShortPinyin('厦门你好大厦厦门'))

Browers

    // <script src="./dist/pinyin4js.js"></script>

    // output: xià#mén#nǐ#hǎo#dà#shà#xià#mén
    console.log(PinyinHelper.convertToPinyinString('厦门你好大厦厦门', '#', PinyinFormat.WITH_TONE_MARK))

    //首字母风格
    // output: xmnhdsxm
    console.log(PinyinHelper.convertToPinyinString('厦门你好大厦厦门', '', PinyinFormat.FIRST_LETTER))
    // or
    console.log(PinyinHelper.getShortPinyin('厦门你好大厦厦门'))

How to Dev

  • Init
    git clone https://github.com/superbiger/pinyin4js.git
    cd pinyin4js
    npm install
    npm run build
  • Build Browser
    npm run build
    npm run build-browser   // PS: 打包浏览器包,必须先执行npm run build
  • Test
    npm run test
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].