mirror of
https://github.com/zh-lx/pinyin-pro.git
synced 2026-03-13 09:51:38 +08:00
feat: 修改性能准确率说明
This commit is contained in:
28
README.md
28
README.md
@@ -8,13 +8,13 @@
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](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。
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
15
benchmark/package.json
Normal file
15
benchmark/package.json
Normal 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"
|
||||
}
|
||||
Reference in New Issue
Block a user