Skip to content

Commit

Permalink
Merge pull request #231 from zh-lx/fix-convert-iu
Browse files Browse the repository at this point in the history
fix: "修复 convert 对于 iu 韵母转换不正确的问题"
  • Loading branch information
zh-lx committed Apr 28, 2024
2 parents 1f42aa7 + 0754cdc commit 0fb63ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core/convert/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const toneMap = {
ü: ['ü', 'ǖ', 'ǘ', 'ǚ', 'ǜ'],
v: ['ü', 'ǖ', 'ǘ', 'ǚ', 'ǜ'],
ui: ['ui', 'uī', 'uí', 'uǐ', 'uì'],
iu: ['iu', 'īu', 'íu', 'ǐu', 'ìu'],
iu: ['iu', '', '', '', ''],
i: ['i', 'ī', 'í', 'ǐ', 'ì'],
u: ['u', 'ū', 'ú', 'ǔ', 'ù'],
n: ['n', 'n', 'ń', 'ň', 'ǹ'],
Expand Down
5 changes: 5 additions & 0 deletions test/convert.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,9 @@ describe('convert', () => {
const result = convert('l2', { format: 'numToSymbol' });
expect(result).to.be.equal('l2');
});

it('[convert]numToSymbol iu', () => {
const result = convert('liu2', { format: 'numToSymbol' });
expect(result).to.be.equal('liú');
});
});

0 comments on commit 0fb63ea

Please sign in to comment.