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

orderChosenfunction

The chosen radicals in the grid's own order, not the order they were clicked, so the choice reads as a row of the grid. A radical the grid does not have is dropped.

Import it

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

Definition

function orderChosen(radicals: readonly Radical[], chosen: readonly string[]): 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

string[]

The chosen radicals in the grid's own order, not the order they were clicked, so the choice reads as a row of the grid. A radical the grid does not have is dropped.

Examples

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

const radicals = RADKFILE.radicals;
console.log(orderChosen(radicals,["田","汁"]));
[ '汁', '田' ]

What it prints (run when this page was built)

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