Skip to content

wlwl2/chinese-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chinese-utils

Utility tools for working with simplified/traditional Chinese characters and Pinyin in Node.js.

Installation

npm i chinese-utils --save

Usage

pinyinToAlphabet()

ChineseUtils.pinyinToAlphabet(string)

Removes the tone marks from a Pinyin string and keeps the original case of the Pinyin and any spaces/whitespace. This is also known as accent folding.

Returns a string with just plain English and no tone marks (keeps the original case of the Pinyin).

Example:

const ChineseUtils = require('chinese-utils');

const examplePinyin = ChineseUtils.pinyinToAlphabet('wǒ mèi mei');

console.log(examplePinyin); // logs 'wo mei mei'

About

Utility functions for working with simplified/traditional Chinese characters and Pinyin in Node.js (npm package).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published