How to use the pinyin.STYLE_INITIALS function in pinyin

To help you get started, we’ve selected a few pinyin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nigulasikk / freeStylePlugin / index.js View on Github external
function getShenMu(word) {
    /**
     * 声母数组
     */
    var shenMu = pinyin(word, {
        style: pinyin.STYLE_INITIALS, // 设置拼音风格
        segment: true,
        heteronym: true
    })
    return shenMu
}
/**

pinyin

汉语拼音转换工具。

MIT
Latest version published 4 months ago

Package Health Score

67 / 100
Full package analysis