Skip to content

Commit

Permalink
Merge pull request #136 from vhly/main
Browse files Browse the repository at this point in the history
feat: 补充姓氏多音字支持:区(ou), 覃(qin), 朴(piao)
  • Loading branch information
zh-lx authored Oct 17, 2023
2 parents 384a595 + b76192a commit 144489d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/data/surname.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,9 @@ const Surnames: { [key: string]: string } = {
: 'yán',
: 'fú',
: 'xiāo',
: 'ōu',
: 'qín',
: 'piáo',
};

export default Surnames;
Expand Down
15 changes: 15 additions & 0 deletions test/surname.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,19 @@ describe('surname', () => {
const result = pinyin('曾令狐冲', { mode: 'surname' });
expect(result).to.be.equal('zēng líng hú chōng');
});

it('[surname]multiple surname4', () => {
const result = pinyin('我叫区中青', { mode: 'surname' });
expect(result).to.be.equal('wǒ jiào ōu zhōng qīng');
});

it('[surname]multiple surname5', () => {
const result = pinyin('我叫覃晓旭', { mode: 'surname' });
expect(result).to.be.equal('wǒ jiào qín xiǎo xù');
});

it('[surname]multiple surname6', () => {
const result = pinyin('我叫朴岁植', { mode: 'surname' });
expect(result).to.be.equal('wǒ jiào piáo suì zhí');
});
});

0 comments on commit 144489d

Please sign in to comment.