Skip to content

Commit

Permalink
Merge pull request #15 from zh-lx/feature-next
Browse files Browse the repository at this point in the history
feat: 3.2.0版本
  • Loading branch information
zh-lx authored May 8, 2021
2 parents 350247e + c881ebd commit 688a733
Show file tree
Hide file tree
Showing 7 changed files with 20,955 additions and 20,869 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 3.2.0

- 根据单字的使用频率调整字典顺序,性能大幅提升,长句的转换时间只需之前版本 50% 左右的时间
- 修复部分单字的常用读音
啊: ā -> a
阿: ē -> ā
- 增加浏览器中 script 的引入方式

## 3.1.0

- 增加获取拼音首字母功能
Expand Down
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@

## 版本更新

当前版本: 3.0.7 -> 3.1.0
当前版本: 3.1.0 -> 3.2.0

- 增加获取拼音首字母功能
- 修复 readme 中音调形式参数 toneType 错写成了 tone 的错误
- 根据单字的使用频率调整字典顺序,性能大幅提升,长句的转换时间只需之前版本 50% 左右的时间
- 修复部分单字的常用读音<br>
- 啊: ā -> a
- 阿: ē -> ā
- 增加浏览器中 script 的引入方式

点击查看 [版本更新文档](./CHANGELOG.md)

Expand All @@ -44,16 +47,28 @@ yarn add pinyin-pro

## 引入

ES6 引入:
浏览器 script 引入:

```html
<script src="https://cdn.jsdelivr.net/gh/zh-lx/[email protected]/dist/pinyin-pro.js"></script>
<script>
var { pinyin } = pinyinPro;
pinyin('汉语拼音'); // 'hàn yǔ pīn yīn'
</script>
```

ESModule 引入:

```javascript
import { pinyin } from 'pinyin-pro';
pinyin('汉语拼音'); // 'hàn yǔ pīn yīn'
```

commonjs 引入:

```javascript
const { pinyin } = require('pinyin-pro');
pinyin('汉语拼音'); // 'hàn yǔ pīn yīn'
```

## 参数
Expand All @@ -75,6 +90,8 @@ const { pinyin } = require('pinyin-pro');
### 获取拼音

```js
import { pinyin } from 'pinyin-pro';

// 获取带音调拼音
pinyin('汉语拼音'); // 'hàn yǔ pīn yīn'
// 获取不带声调的拼音
Expand Down Expand Up @@ -150,6 +167,8 @@ pinyin('赵钱孙李额', { pattern: 'first', toneType: 'none', type: 'array'
只有单字可以获取到多音模式, 词语、句子无效。同样可以通过配置 options 选项获取数组形式、韵母等格式

```javascript
import { pinyin } from 'pinyin-pro';

// 获取多音
pinyin('', { multiple: true }); // 'hǎo hào'
// 获取数组形式多音
Expand Down
Loading

0 comments on commit 688a733

Please sign in to comment.