Skip to the content

Bushu部首

Choose the parts you can see in a kanji, intersect their matches, and add a radical picker to your page.

Bushu is the Japanese word 部首 for a kanji radical. About the name

Contents

Reference · Radical intersection and display forms

radicalsInKanjifunction

The radicals a character is written with, fewest strokes first.

RADKFILE is stored radical by radical, each with the kanji that hold it, because that is the direction a search runs. A kanji page asks the opposite question, and a membership test per radical answers it, which is nothing next to keeping a second copy of the index the other way round. Simplest parts first, so the list reads the way the character is built up. Code point order breaks a tie, never a locale's collation, so the same character lists its parts in the same order on every machine.

Import it

import { radicalsInKanji } from "@johnmorrisdotca/bushu";

Definition

function radicalsInKanji(radicals: readonly Radical[], kanji: string): Radical[]

Parameters

NameTypeDescription
radicalsreadonly Radical[]

The native radical entries; these inputs are read without mutation.

kanjistring

The kanji to look up, or the supplied kanji list where the signature requires an array.

Returns

Radical[]

The radicals a character is written with, fewest strokes first.

Examples

import { RADKFILE } from "@johnmorrisdotca/bushu/radkfile";
import { radicalsInKanji } from "@johnmorrisdotca/bushu";

const radicals = RADKFILE.radicals;
console.log(radicalsInKanji(radicals,"海").map(part=>part.radical));
[ '乞', '汁', '毋', '母' ]

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/bushu 1.1.0.