Reference · Radical intersection and display forms
kanjiForRadicalsfunction
The kanji that hold every one of the chosen radicals, in the order of the first radical's list (the dictionary's own).
Nothing chosen means nothing to show: the whole dictionary is not an answer to a question nobody has asked yet. A radical that is not in the list cannot be satisfied, so the answer is nothing.
Import it
import { kanjiForRadicals } from "@johnmorrisdotca/bushu";
Definition
function kanjiForRadicals(radicals: readonly Radical[], chosen: readonly string[]): string[]
Parameters
| Name | Type | Description |
|---|---|---|
radicals | readonly Radical[] | The native radical entries; these inputs are read without mutation. |
chosen | readonly string[] | Chosen RADKFILE keys, interpreted as an intersection of all chosen parts. |
Returns
string[]
The kanji that hold every one of the chosen radicals, in the order of the first radical's list (the dictionary's own).
Examples
import { RADKFILE } from "@johnmorrisdotca/bushu/radkfile";
import { kanjiForRadicals } from "@johnmorrisdotca/bushu";
const radicals = RADKFILE.radicals;
console.log(kanjiForRadicals(radicals,["汁","田"]).slice(0,5));[ '演', '浬', '漁', '滝', '薄' ]What it prints (run when this page was built)