kanjiCost関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The cost of one kanji.
School grades are the scale a family already understands, so grades 1 to 6 cost their own number.
Grade 8 is the rest of jōyō, taught in secondary school, and 9 and 10 are the name kanji, which a
learner meets late if at all. Ungraded characters fall back to how common they are, since a frequent
character is easier than a rare one whatever any curriculum says. A kanji nothing is known about
costs UNKNOWN_KANJI_COST, the most.
インポート
import { kanjiCost } from "@johnmorrisdotca/hikidashi/difficulty";
ほかのエクスポート元: @johnmorrisdotca/hikidashi
定義
function kanjiCost(entry: KanjiDifficultySource | null | undefined): number
引数
| 名前 | 型 | 説明 |
|---|---|---|
entry | KanjiDifficultySource | null | undefined | What you hold about the kanji; null or undefined when you hold nothing. |
戻り値
number
The cost: 1 to 6 for grades 1 to 6, 9 for grade 8, 14 for name kanji (9 and 10), 10 to 18 by frequency
for an ungraded kanji, and 20 (UNKNOWN_KANJI_COST) when nothing is known.
例
import { kanjiCost } from "@johnmorrisdotca/hikidashi/difficulty";
console.log(kanjiCost({ grade: 3, frequencyRank: 969 }), kanjiCost({ grade: 8, frequencyRank: 1500 }));
console.log(kanjiCost({ grade: null, frequencyRank: 2400 }), kanjiCost(undefined));3 9
16 20出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。