radicalsInKanji関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { radicalsInKanji } from "@johnmorrisdotca/bushu";
定義
function radicalsInKanji(radicals: readonly Radical[], kanji: string): Radical[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
radicals | readonly Radical[] | The native radical entries; these inputs are read without mutation. |
kanji | string | The kanji to look up, or the supplied kanji list where the signature requires an array. |
戻り値
Radical[]
The radicals a character is written with, fewest strokes first.
例
import { RADKFILE } from "@johnmorrisdotca/bushu/radkfile";
import { radicalsInKanji } from "@johnmorrisdotca/bushu";
const radicals = RADKFILE.radicals;
console.log(radicalsInKanji(radicals,"海").map(part=>part.radical));[ '乞', '汁', '毋', '母' ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。