Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

zhuyin-improved

nick109238745656ISC1.0.7TypeScript support: included

Convert Zhuyin to Pinyin

chinese, mandarin, pinyin, zhuyin, 中文, 拼音, 注音

readme

improved

  • 修正無法轉換單音的bug
  • 修正注音4聲會轉換錯誤的bug
  • 修正注音'ㄩ'轉換成pinyin會不正確的問題。
  • 修正輕聲判別位置賺前後與轉換後,應在前方而不是在後方。 ex: X[ㄇㄜ˙],O[˙ㄇㄜ]
  • 加入一些少用的拼音。 ex: 黁[ㄋㄨㄣˊ]

Install

npm install zhuyin-imporved

Usage

const zhuyin = require("zhuyin-improved")

zhuyin("wǒ de māo xǐhuan hē níunǎi").then(console.log)

zhuyin("wo3 de mao1 xi3huan he1niu2 nai3").then(console.log)

zhuyin("wǒdemāoxǐhuanhēníunǎi").then(console.log)

zhuyin("wo3demao1xi3huanhe1niu2nai3").then(console.log)

// [ 'ㄨㄛˇ', 'ㄉㄜ˙', 'ㄇㄠ', 'ㄒㄧˇ', 'ㄏㄨㄢ˙', 'ㄏㄜ', 'ㄋㄧㄡˊ', 'ㄋㄞˇ' ]

changelog

[1.0.1] - 2024-06-11

Fixed

  • 修正無法轉換單音的問題。

[1.0.2] - 2024-06-11

Fixed

  • 修正注音4聲會轉換錯誤的bug。

[1.0.3] - 2024-06-20

Fixed

  • 修正 "ㄩ" 轉換 pinyin 不正確的問題。

[1.0.4] - 2024-06-20

Fixed

  • 修正 "ㄩ" 轉換 pinyin 不正確的問題。

[1.0.5] - 2024-06-21

Fixed

  • 修正 輕聲 "˙" 位置應該在注音前方的問題。

[1.0.6] - 2024-07-14

Fixed

  • 加入一些少用的拼音,比如「ㄋㄨㄣˊ」。

[1.0.7] - 2024-07-16

Fixed

  • 將1.0.5的改動套用至esm模組