0.2.4 • Published 5 years ago

@nahanil/zh-decomp v0.2.4

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

@nahanil/zh-decomp

pipeline status coverage report NPM version

Decompose Chinese characters

npm install --save @nahanil/zh-decomp
const decomp = require('@nahanil/zh-decomp')

lookup(char)

let res = decomp.lookup('蟆');
/*
{
  "label": "蟆",
  "children": [
    {
      "label": "虫"
    },
    {
      "label": "莫",
      "children": [
        {
          "label": "艹"
        },
        {
          "label": "旲",
          "children": [
            {
              "label": "日"
            },
            {
              "label": "大"
            }
          ]
        }
      ]
    }
  ]
}
*/

radical(char)

This will likely be removed in future in favour of @nahanil/bushou

decomp.radical('蟆')
// '虫' <-- Found radical

decomp.radical('虫')
// '*' <-- 虫 is a radical

decomp.radical('U')
// null <-- 'U' not found

Source

https://commons.wikimedia.org/wiki/Commons:Chinese_characters_decomposition

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago