Reference · Look words up by reading, written form, English meaning, kanji or romaji
wordsWithKanjifunction
Words written with a kanji, the commonest first, each shown by the written form that holds the kanji. The index holds the
readings of the commonest sixty words with each kanji, so limit words cost the kanji's piece, about 15 kB gzipped, and at
most that many pieces of the dictionary. Show each word's kanji with kanjiOfWord.
The words are in the mode asked for, and the block and allow lists are laid over them, as for loadWords. A piece that
cannot be fetched rejects with a WordsLoadError.
Import it
import { wordsWithKanji } from "@johnmorrisdotca/jisho/words";
Definition
function wordsWithKanji(kanji: string, options?: FindOptions): Promise<Word[]>
Parameters
| Name | Type | Description |
|---|---|---|
kanji | string | A kanji; the first one in the text is used. |
options (optional) | FindOptions | The mode, the lists, and the most words to give (10 unless given, and no more than 20). |
Returns
Promise<Word[]>
The words, the commonest first; none for a text with no kanji in it, or a kanji no word is written with.
Examples
import { wordsWithKanji } from "@johnmorrisdotca/jisho/words";
const words = await wordsWithKanji("山", { limit: 5 });
console.log(words.map((one) => `${one.written} ${one.meaning}`)); // ["山 mountain; hill; ...", ...][
'山 mountain, hill; mine',
'火山 volcano',
'青山 lush mountain, green mountain; grave, burial place',
'聖山 holy mountain, sacred hill',
'西山 western mountains, mountains to the west'
]What it prints (run when this page was built)