pinyin-pro
Advanced tools
Comparing version 3.0.1 to 3.0.2-alpha.0
{ | ||
"name": "pinyin-pro", | ||
"version": "3.0.1", | ||
"version": "3.0.2-alpha.0", | ||
"description": "汉字转拼音库。获取汉字、词语、句子等内容的拼音、韵母、声母、声调等信息。", | ||
"main": "./dist/index.js", | ||
"typings": "./types/lib/index.d.ts", | ||
"files": [ | ||
"dist", | ||
"types", | ||
"tsconfig.json" | ||
], | ||
"scripts": { | ||
"test": "jest", | ||
"test": "mocha", | ||
"build": "rollup -c", | ||
"commit": "git-cz" | ||
"commit": "git-cz", | ||
"coverage": "istanbul cover _mocha -- -R spec --timeout 15000 --recursive", | ||
"coverage:check": "istanbul check-coverage", | ||
"cover": "istanbul cover --report lcov node_modules/mocha/bin/_mocha -- -R spec test/*.js" | ||
}, | ||
@@ -38,2 +36,6 @@ "repository": { | ||
"devDependencies": { | ||
"@babel/core": "^7.13.10", | ||
"@babel/preset-env": "^7.13.12", | ||
"@babel/preset-typescript": "^7.13.0", | ||
"@babel/register": "^7.13.8", | ||
"@commitlint/cli": "^11.0.0", | ||
@@ -45,3 +47,7 @@ "@commitlint/config-conventional": "^11.0.0", | ||
"@types/jest": "^26.0.20", | ||
"chai": "^4.3.4", | ||
"commitizen": "^4.2.2", | ||
"coveralls": "^3.1.0", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^8.3.2", | ||
"rollup": "^2.42.1", | ||
@@ -48,0 +54,0 @@ "rollup-plugin-cleanup": "^3.2.1", |
@@ -1,13 +0,28 @@ | ||
# pinyin-pro 汉字拼音转换工具(支持获取汉字、词语、句子的拼音、音调、声母、韵母多种形式) | ||
[![pinyin-pro Logo](https://i.ibb.co/26fJ5vF/pinyin-logo.png)](https://github.com/zh-lx/pinyin-pro) | ||
汉字拼音转换工具,支持获取汉字、词语、句子等多种内容的拼音、音调、声母、韵母等,支持繁体和简体字。通过高效的算法和丰富的字词库,保证体积轻量的同时识别准确率很高。 | ||
pinyin-pro —— 专业的汉字拼音转换工具 | ||
## 版本更新文档 | ||
[![NPM version](https://img.shields.io/npm/v/pinyin-pro.svg)](https://www.npmjs.com/package/pinyin-pro) | ||
[![GITHUB star](https://img.shields.io/github/stars/zh-lx/pinyin-pro.svg)](https://github.com/zh-lx/pinyin-pro) | ||
[![travis-build](https://travis-ci.com/zh-lx/pinyin-pro.svg?branch=main)](https://travis-ci.com/github/zh-lx/pinyin-pro) | ||
[![NPM Downloads](https://img.shields.io/npm/dm/pinyin-pro.svg)](https://npmcharts.com/compare/pinyin-pro?minimal=true) | ||
[![Coverage Status](https://coveralls.io/repos/github/zh-lx/pinyin-pro/badge.svg?branch=main)](https://coveralls.io/github/zh-lx/pinyin-pro?branch=main) | ||
当前版本: 3.0.0 -> 3.0.1 | ||
## 特色功能 | ||
- 修复没有 index.d.ts 类型指向的问题 | ||
- 支持汉字、词语、句子等多种格式的拼音、声母、韵母、音调等多种转换形式 | ||
- 支持多音字,词语句子智能获取读音 | ||
- 支持繁体字和简体字 | ||
- 支持字符串和数组两种输出格式 | ||
- 通过高效的算法,有效加快查找速度 | ||
- 对包体积进行了优化,保证识别准确的同时体积轻便 | ||
[版本更新文档](./docs/versions.md) | ||
## 版本更新 | ||
当前版本: 3.0.1 -> 3.0.2 | ||
- 优化了 npm 包质量和 readme | ||
点击查看 [版本更新文档](./docs/versions.md) | ||
## 安装 | ||
@@ -27,3 +42,3 @@ | ||
## 使用 | ||
## 引入 | ||
@@ -47,4 +62,13 @@ 浏览器端: | ||
- <b>word:</b>必填。String 类型,需要转化为拼音的中文 | ||
- <b>options:</b>可选。Object 类型,用于配置各种输出形式,相关配置在后面有所介绍 | ||
- <b>options:</b>可选。Object 类型,用于配置各种输出形式,options 的键值配置如下: | ||
| 参数 | 说明 | 类型 | 可选值 | 默认值 | | ||
| -------- | ------------------------------------------------------------- | ------- | ------------------------------ | ------ | | ||
| pattern | 输出的结果的信息(拼音 / 声母 / 韵母 / 音调) | string | pinyin / initial / final / num | pinyin | | ||
| tone | 音调输出形式(拼音符号 / 数字 / 不加音调) | string | symbol / num / none | symbol | | ||
| type | 输出结果类型(字符串/数组) | string | string / array | string | | ||
| multiple | 输出多音字全部拼音(仅在 word 为长度为 1 的汉字字符串时生效) | boolean | true / false | false | | ||
## 使用 | ||
### 基本用法 | ||
@@ -103,13 +127,7 @@ | ||
## options 配置 | ||
## 贡献与反馈 | ||
| 参数 | 说明 | 类型 | 可选值 | 默认值 | | ||
| -------- | ------------------------------------------------------------- | ------- | ------------------------------ | ------ | | ||
| pattern | 输出的结果的信息(拼音 / 声母 / 韵母 / 音调) | string | pinyin / initial / final / num | pinyin | | ||
| tone | 音调输出形式(拼音符号 / 数字 / 不加音调) | string | symbol / num / none | symbol | | ||
| type | 输出结果类型(字符串/数组) | string | string / array | string | | ||
| multiple | 输出多音字全部拼音(仅在 word 为长度为 1 的汉字字符串时生效) | boolean | true / false | false | | ||
使用遇到问题或者需要功能支持欢迎提 issue。 | ||
## 交流与反馈 | ||
有问题或者功能需求支持欢迎提 issue | ||
交流及参与贡献欢迎加微信: | ||
zhoulx1688888 |
@@ -1,2 +0,2 @@ | ||
interface Options { | ||
declare type PinyinFn = (word: string, options?: { | ||
toneType?: 'symbol' | 'num' | 'none'; | ||
@@ -6,5 +6,4 @@ pattern?: 'pinyin' | 'initial' | 'final' | 'num'; | ||
multiple?: boolean; | ||
} | ||
declare type PinyinFn = (word: string, options?: Options) => string | string[]; | ||
}) => string | string[]; | ||
declare const pinyinFn: PinyinFn; | ||
export { pinyinFn }; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1093702
30
30505
131
20
1
1