@nahanil/bushou

0.0.3 • Public • Published

@nahanil/bushou

pipeline status coverage report NPM version    

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
    },
    // ...
  ]
*/

Readme

Keywords

none

Package Sidebar

Install

npm i @nahanil/bushou

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

291 kB

Total Files

6

Last publish

Collaborators

  • nahanil