Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

吕姓pinyin怎么处理成LYU #375

Closed
cfop0608 opened this issue Sep 25, 2023 · 2 comments · Fixed by #377
Closed

吕姓pinyin怎么处理成LYU #375

cfop0608 opened this issue Sep 25, 2023 · 2 comments · Fixed by #377

Comments

@cfop0608
Copy link

吕姓pinyin怎么处理成LYU

@ifunjoke
Copy link

ifunjoke commented Oct 8, 2023

const py = await import(`https://cdn.jsdelivr.net/npm/pinyin@3.0.0-alpha.5/+esm`);
let surname = "吕一";
console.log(py.pinyin(surname, {
		style: 'NORMAL',
		mode: "NORMAL",
		segment: false,
		group: false
	})
	.map((v, i) => {
		console.log(v, i, surname[i]);
		return v?.[0] === 'lv' && surname[i] === '吕' ? 'LYU' : v
	})
	.join(' '));

result

console print LYU yi

@hotoo
Copy link
Owner

hotoo commented Oct 31, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants