Reference · Look words up by reading, written form, English meaning, kanji or romaji
kanjiOfWordfunction
The entries of the kanji table for the kanji a word is written with, once each, in the order they appear: so a word can show its kanji with their grade, JLPT level, readings and meanings. A kanji the table does not hold is left out, and a word with no kanji (it is written in kana) has none. A word usually written in kana is looked at by its commonest written form.
Import it
import { kanjiOfWord } from "@johnmorrisdotca/jisho/words";
Definition
function kanjiOfWord(word: Word, kanji: readonly Kanji[]): Kanji[]
Parameters
| Name | Type | Description |
|---|---|---|
word | Word | A word a lookup returned. |
kanji | readonly Kanji[] | The rows of the table, from |
Returns
Kanji[]
The kanji of the word, in order.
Examples
import { readKanji } from "@johnmorrisdotca/jisho";
import { KANJI } from "@johnmorrisdotca/jisho/kanji";
import { kanjiOfWord, loadWords, wordsOf } from "@johnmorrisdotca/jisho/words";
const word = wordsOf(await loadWords("やま"), "やま")[0];
console.log(word && kanjiOfWord(word, readKanji(KANJI)).map((one) => `${one.kanji} grade ${one.grade}`)); // ["山 grade 1"][ '山 grade 1' ]What it prints (run when this page was built)