Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pinyin-pro

Package Overview
Dependencies
Maintainers
1
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pinyin-pro

汉字转拼音库。获取中文拼音、韵母、声母、声调、首字母,支持拼音匹配

  • 3.12.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25K
decreased by-23.36%
Maintainers
1
Weekly downloads
 
Created
Source

pinyin-pro Logo

NPM version GITHUB star travis-build NPM Downloads Coverage Status MIT-license GITHUB-language

介绍

pinyin-pro 是一个专业的 js 汉字拼音转换库,功能丰富、准确率高、性能优异。

使用文档 | 在线运行

特色功能

  • 获取汉字、词语、句子等多种格式的拼音
  • 获取声母
  • 获取韵母、韵头、韵腹、韵尾
  • 获取拼音首字母
  • 获取音调
  • 获取多音字的多种拼音
  • 支持人名姓氏模式
  • 支持自定义拼音
  • 支持字符串和数组两种输出形式
  • 支持拼音文本匹配功能

安装

npm 安装

npm install pinyin-pro

浏览器引入

<script src="https://unpkg.com/pinyin-pro"></script>

使用示例

更多功能的使用说明文档请查看使用示例

import { pinyin } from 'pinyin-pro';

// 获取带音调拼音
pinyin('汉语拼音'); // 'hàn yǔ pīn yīn'

// 获取数组形式带音调拼音
pinyin('汉语拼音', { type: 'array' }); // ["hàn", "yǔ", "pīn", "yīn"]

// 获取数组形式不带声调的拼音
pinyin('汉语拼音', { toneType: 'none', type: 'array' }); // ["han", "yu", "pin", "yin"]

// 获取带音调韵母
pinyin('汉语拼音', { pattern: 'final' }); // 'àn ǔ īn īn'

贡献与反馈

参与开源贡献请参照 pinyin-pro 贡献

使用遇到问题或者需要功能支持欢迎提 issue。

技术交流欢迎加微信:

Keywords

FAQs

Package last updated on 24 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc