リファレンス · 読み、表記、英語の意味、漢字、ローマ字から単語を引く
wordsWithKanji関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { wordsWithKanji } from "@johnmorrisdotca/jisho/words";
定義
function wordsWithKanji(kanji: string, options?: FindOptions): Promise<Word[]>
引数
| 名前 | 型 | 説明 |
|---|---|---|
kanji | string | A kanji; the first one in the text is used. |
options (省略可) | FindOptions | The mode, the lists, and the most words to give (10 unless given, and no more than 20). |
戻り値
Promise<Word[]>
The words, the commonest first; none for a text with no kanji in it, or a kanji no word is written with.
例
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'
]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。