mirror of
https://github.com/zh-lx/pinyin-pro.git
synced 2026-03-13 09:51:38 +08:00
fix: 增加 xuan 的韵母
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
rollup.config.js
|
||||
docs
|
||||
coverage
|
||||
dist/pinyin-pro.js
|
||||
.github
|
||||
.husky
|
||||
handle-data
|
||||
handle-data
|
||||
lib
|
||||
data
|
||||
test
|
||||
@@ -27,6 +27,11 @@ export const InitialList = [
|
||||
|
||||
export const SpecialInitialList = ['j', 'q', 'x'];
|
||||
export const SpecialFinalList = [
|
||||
'uān',
|
||||
'uán',
|
||||
'uǎn',
|
||||
'uàn',
|
||||
'uan',
|
||||
'ūn',
|
||||
'ún',
|
||||
'ǔn',
|
||||
@@ -40,6 +45,11 @@ export const SpecialFinalList = [
|
||||
];
|
||||
|
||||
export const SpecialFinalMap = {
|
||||
uān: 'üān',
|
||||
uán: 'üán',
|
||||
uǎn: 'üǎn',
|
||||
uàn: 'üàn',
|
||||
uan: 'üan',
|
||||
ūn: 'ǖn',
|
||||
ún: 'ǘn',
|
||||
ǔn: 'ǚn',
|
||||
@@ -51,3 +61,5 @@ export const SpecialFinalMap = {
|
||||
ù: 'ǜ',
|
||||
u: 'ü',
|
||||
};
|
||||
|
||||
export const doubleFinal = [];
|
||||
|
||||
@@ -25,8 +25,19 @@ interface BasicOptions {
|
||||
* @value final:返回韵母
|
||||
* @value num:返回音调对应的数字
|
||||
* @value first:返回首字母
|
||||
* @value finalHead:返回韵头(介音)
|
||||
* @value finalBody:返回韵腹
|
||||
* @value finalTail:返回韵尾
|
||||
*/
|
||||
pattern?: 'pinyin' | 'initial' | 'final' | 'num' | 'first';
|
||||
pattern?:
|
||||
| 'pinyin'
|
||||
| 'initial'
|
||||
| 'final'
|
||||
| 'num'
|
||||
| 'first'
|
||||
| 'finalHead'
|
||||
| 'finalBody'
|
||||
| 'finalTail';
|
||||
/**
|
||||
* @description 是否返回单个汉字的所有多音,仅针对输入的 word 为单个汉字生效
|
||||
* @value false:返回最常用的一个拼音 (默认值)
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/zh-lx/pinyin-pro.git"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"types"
|
||||
],
|
||||
"keywords": [
|
||||
"拼音",
|
||||
"pinyin",
|
||||
|
||||
@@ -293,6 +293,7 @@ describe('surname', () => {
|
||||
|
||||
describe('pinyinFn', () => {
|
||||
it('not string type', () => {
|
||||
// @ts-ignore
|
||||
const result = pinyin(2222);
|
||||
expect(result).to.be.equal(2222);
|
||||
});
|
||||
@@ -576,5 +577,10 @@ describe('customConfig', () => {
|
||||
pattern: 'final',
|
||||
});
|
||||
expect(result1).to.deep.equal('ǘ');
|
||||
|
||||
const result2 = pinyin('选', {
|
||||
pattern: 'final',
|
||||
});
|
||||
expect(result1).to.deep.equal('üǎn');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user