gradeOf関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Which grade a kanji is taught in.
インポート
import { gradeOf } from "@johnmorrisdotca/jisho";
定義
function gradeOf(table: GradeTable, kanji: string): SchoolGrade | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
table | GradeTable |
|
kanji | string | One kanji. |
戻り値
SchoolGrade | null
The grade, or null when KANJIDIC2 gives the kanji none (it is outside the jōyō and jinmeiyō kanji), or when the text is not exactly one character: an empty text and a text of two kanji are not any kanji's grade.
例
import { gradeOf } from "@johnmorrisdotca/jisho";
import { GRADES } from "@johnmorrisdotca/jisho/grades";
console.log(gradeOf(GRADES, "日"), gradeOf(GRADES, "鬱"), gradeOf(GRADES, "龘")); // 1 8 null1 8 null出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。