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

usableRadicalsfunction

The radicals that can still narrow what is left: every one that appears in at least one of the kanji that match now.

A radical in none of the remaining kanji is a dead end, which a picker dims rather than let you click your way to an empty list. The chosen ones stay in the set: taking one back must always be possible. With nothing chosen, every radical can.

Import it

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

Definition

function usableRadicals(radicals: readonly Radical[], chosen: readonly string[]): Set<string>

Parameters

NameTypeDescription
radicalsreadonly Radical[]

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

chosenreadonly string[]

Chosen RADKFILE keys, interpreted as an intersection of all chosen parts.

Returns

Set<string>

The radicals that can still narrow what is left: every one that appears in at least one of the kanji that match now.

Examples

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

const radicals = RADKFILE.radicals;
console.log(usableRadicals(radicals,["汁","田"]).has("汁"));
true

What it prints (run when this page was built)

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