本文へ移動

Hikidashi引き出し

和暦と漢数字の相互変換、活用した語の辞書形、漢字への読みの割り当て、貼り付けた文からの単語の抽出、文の難しさ。日本語のテキストを扱う小さな道具を集めた引き出しです。

「引き出し」という名前は、道具が一つずつしまってあり、必要なときに取り出して使える、という意味です。 名前について(英語)

目次

リファレンス · 文の難しさ

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

引数

名前型説明
entryKanjiDifficultySource | 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

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/hikidashi 1.1.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。