@nahanil/bushou
v0.0.3
Published
Work with Chinese radicals
Downloads
8
Readme
@nahanil/bushou
Work with Chinese radicals
npm install --save @nahanil/bushou
# or
yarn add @nahanil/bushou
Find radical for a given character
nb. Returns '*' if the provided character is itself a radical
let radical = rad.for('海')
// 水
let radical = rad.for('水')
// *
Find radical for a given character (extended)
let radical = rad.for('海', true)
/*
{
no: 85,
radical: '水',
variants: '氵',
simplified: '',
pinyin: 'shui3',
english: 'water',
strokes: 4
}
*/
Find radical by KangXi index
let radical = rad.byIndex(85)
/*
{
no: 85,
radical: '水',
variants: '氵',
simplified: '',
pinyin: 'shui3',
english: 'water',
strokes: 4
}
*/
List all radicals
let radicals = rad.list()
/*
[
// ...
{
no: 85,
radical: '水',
variants: '氵',
simplified: '',
pinyin: 'shui3',
english: 'water',
strokes: 4
},
// ...
]
*/