本文へ移動

Jisho辞書

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

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

目次

リファレンス · KanjiVG由来の筆順:描く、描いた漢字から探す

findByDrawing関数

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

The kanji whose strokes are nearest to what was drawn, nearest first. The strokes are compared one by one, in the order they were drawn, so a kanji has to be drawn with the right number of strokes (one more or fewer is allowed, at a cost) and in the order it is written. The size and the place of the drawing do not matter; the lengths and directions of the strokes do. It reads the table as it is and fetches nothing.

インポート

import { findByDrawing } from "@johnmorrisdotca/jisho/strokes";

定義

function findByDrawing(table: PackedStrokes, drawn: readonly (readonly Point[])[], options?: { readonly limit?: number; }): DrawingMatch[]

引数

名前型説明
tablePackedStrokes

What loadStrokes or loadAllStrokes gave.

drawnreadonly (readonly Point[])[]

The strokes, each a list of points in any units (a canvas's pixels, say), in the order they were drawn. A stroke of one point is a dot.

options (省略可){ readonly limit?: number; }

limit, how many to give: 8 unless given.

戻り値

DrawingMatch[]

The nearest kanji, with their distances; none for a drawing with no stroke.

例

import { findByDrawing, loadAllStrokes } from "@johnmorrisdotca/jisho/strokes";

const drawn = [[[10, 50], [90, 50]]] as const; // one straight line across
console.log(findByDrawing(await loadAllStrokes(), drawn, { limit: 1 })[0]?.kanji); // 一
一

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

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

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