This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 1,000,000+ packages pre-installed, including
cantonese with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
Cantonese romanization. Cantonese to Latin conversion. Supports Traditional and Simplified Chinese characters.
Install via npm:
npm i cantonese
The Cantonese pronunciation data are from www.kawa.net. Please note that not all Chinese characters have corresponding pronunciations in Cantonese.
Function toLatin (
Returns possible pronunciations of a Chinese character in Cantonese.
Function fromLatin (
Returns all Chinese characters with specific pronunciation in Cantonese.
var cantonese = require('cantonese'); console.log(cantonese.toLatin('長')); // [ 'cheung', 'jeung' ] console.log(cantonese.fromLatin('cheung')); // [ '倡', '呛', '唱', '嗆', '场', '場', '墙', '娼', '戕', '抢', // '搶', '昌', '暢', '枪', '槍', '牆', '猖', '畅', '祥', '窗', // '翔', '肠', '腸', '蔷', '薔', '詳', '详', '長', '长' ]