本文へ移動

Jisho辞書

JMdictの単語を読み、表記、英語の意味、含まれる漢字、ローマ字から引け、必要な小さなチャンクだけを取得します。初期値はセーフモードで、各語義にはJMdictの印が付き、「フィルターなし」も選べます。2,999字の漢字の学年、JLPTレベル、読み、意味、形の似た漢字の組も収め、表ごとに独立したエントリポイントがあります。

「Jisho」は「辞書」のローマ字表記です。日本語の単語と漢字を収めています。 名前について(英語)

目次

リファレンス · 読み、表記、英語の意味、漢字、ローマ字から単語を引く

readText関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

Reads a text: it is cut into words by taking, from each place, the longest stretch that the dictionary has a word for, either as it stands or as a conjugated form (食べなかった is 食べる). Each word comes with its furigana, its meaning, the hardest JLPT level among its kanji, and each kanji's grade and level; a stretch of Japanese that no word fits is unknown and is listed; spaces, punctuation, Latin letters and digits are kept as other. Nothing but Jisho's own pieces is fetched, about 25 kB gzipped each, as the stretches need them (a few for each word), and a piece is kept for the next one, so a text costs the pieces of its words once.

It picks the longest stretch, not the best reading of a sentence: there is no model of grammar, so a rare word that happens to be longer can win, and a name is unknown or cut into small words. Among equal stretches the commonest word is taken, and the others are in alternatives. In safe mode a word the mode leaves out is not found, so its text is unknown.

インポート

import { readText } from "@johnmorrisdotca/jisho/words";

定義

function readText(text: string, options?: WordsOptions): Promise<ReadResult>

引数

名前型説明
textstring

Japanese text, up to MAX_READ_LENGTH characters.

options (省略可)WordsOptions

The mode, the block and allow lists, as for loadWords.

戻り値

Promise<ReadResult>

The pieces, the unknown stretches and the JMdict release.

例

import { readText } from "@johnmorrisdotca/jisho/words";

const result = await readText("私は寿司を食べなかった。");
console.log(result.tokens.map((token) => token.text)); // ["私", "は", "寿司", "を", "食べなかった", "。"]
[ '私', 'は', '寿司', 'を', '食べなかった', '。' ]

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

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

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