chinese-alphabetize
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.4 • Public • Published

    Alphabetize · NPM version Build Status Coverage Status code style: prettier

    To get chinese pinyin or alphabet from chinese. 从汉字提取拼音,返回首字母大写形式;提取首字母,返回大写形式。

    Browsers support

    IE / Edge
    IE / Edge
    Firefox
    Firefox
    Chrome
    Chrome
    Safari
    Safari
    iOS Safari
    iOS Safari
    Opera
    Opera
    IE8+ Edge+ last 10 versions last 10 versions last 2 versions last 2 versions last 2 versions

    Install

    npm i chinese-alphabetize -S
    or
    yarn add chinese-alphabetize
    

    Usage

    import Alphabetize, { getFullChars, getCamelChars } from 'chinese-alphabetize'
    or
    const Alphabetize, { getFullChars, getCamelChars } = require('chinese-alphabetize')

    . getFullChars(提取拼音,返回首字母大写形式)

    <
    Alphabetize.getFullChars('张三')
    
    ->
    ZhangSan

    . getCamelChars(提取首字母,返回大写形式)

    <
    Alphabetize.getCamelChars('张三铅')
    Alphabetize.getCamelChars('张三铅', { checkPolyphone: true })
    
    ->
    ZSQ
    ['ZSQ', 'ZSY']

    More

    Install

    npm i chinese-alphabetize

    DownloadsWeekly Downloads

    13

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    551 kB

    Total Files

    40

    Last publish

    Collaborators

    • ipxxiao