feat: 修改性能准确率说明

This commit is contained in:
zh-lx
2023-05-17 08:55:10 +08:00
parent a8bd114664
commit a2ec442c50
3 changed files with 49 additions and 16 deletions

View File

@@ -8,13 +8,13 @@
[![MIT-license](https://img.shields.io/npm/l/pinyin-pro.svg)](https://opensource.org/licenses/MIT)
[![GITHUB-language](https://img.shields.io/github/languages/top/zh-lx/pinyin-pro.svg)](https://github.com/zh-lx/pinyin-pro)
### 介绍
### 📖 介绍
`pinyin-pro` 是一个专业的 js 汉字拼音转换库,功能丰富、准确率高、性能优异。
[使用文档](https://pinyin-pro.cn) | [在线运行](https://pinyin-pro.cn/run/run)
### 特色功能
### 🎨 特色功能
- 获取汉字、词语、句子等多种格式的拼音
- 获取声母
@@ -27,7 +27,7 @@
- 支持字符串和数组两种输出形式
- 支持拼音文本匹配功能
### 安装
### 🔨 安装
npm 安装
@@ -41,7 +41,7 @@ npm install pinyin-pro
<script src="https://unpkg.com/pinyin-pro"></script>
```
### 使用示例
### 💡 使用示例
更多功能的使用说明文档请查看[使用示例](https://pinyin-pro.cn/use/pinyin)
@@ -61,18 +61,20 @@ pinyin('汉语拼音', { toneType: 'none', type: 'array' }); // ["han", "yu", "p
pinyin('汉语拼音', { pattern: 'final' }); // 'àn ǔ īn īn'
```
### 性能及准确率
### 🆚 竞品对比
以下是 `pinyin-pro``pinyin``@napi-rs/pinyin` 包对于汉字转换的速度及准确率对比,更多细节可以参考
以下是 `pinyin-pro``pinyin``@napi-rs/pinyin` 包对于汉字转换的速度及准确率对比,更多细节可以参考 [性能准确率说明](https://pinyin-pro.cn/guide/compare.html)
| 对比项 | pinyin | pinyin-pro | @napi-rs/pinyin |
| ------------------ | ---------------- | ---------- | --------------- |
| 准确率 | 97.844% | 99.744% | 97.433% |
| 5k 字转换所需时间 | 489.252ms | 5.909ms | 115.723ms |
| 1w 字转换所需时间 | 511.573ms | 15.260ms | 115.887ms |
| 100w 字转换所需时间 | 内存溢出转换失败 | 595.131ms | 570.994s |
| 对比项 | pinyin | @napi-rs/pinyin | pinyin-pro |
| ------------------- | ------------------------------------ | --------------- | ---------- |
| 准确率 | Node 版:97.844%<br />Web 版: 94.507% | 97.433% | 99.744% |
| 5k 字转换所需时间 | 489.252ms | 115.723ms | 5.909ms |
| 1w 字转换所需时间 | 511.573ms | 115.887ms | 15.260ms |
| 100w 字转换所需时间 | 内存溢出转换失败 | 570.994s | 595.131ms |
| 是否支持 Node 环境 | ✅ | ✅ | ✅ |
| 100w 字转换所需时间 | ✅ | ❌ | ✅ |
### 反馈
### 📞 反馈
使用遇到问题或者需要功能支持欢迎提 issue。

View File

File diff suppressed because one or more lines are too long

15
benchmark/package.json Normal file
View File

@@ -0,0 +1,15 @@
{
"name": "benchmark",
"version": "1.0.0",
"private": true,
"devDependencies": {
"@napi-rs/pinyin": "^1.7.1",
"pinyin": "^3.0.0-alpha.4"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}