Skip to the content

Jisho辞書

The words of JMdict looked up by reading, written form, English meaning, a kanji in them or romaji, in small pieces fetched as needed, safe by default or unfiltered with every sense's marks, and the school grades, JLPT levels, readings, meanings and look-alike pairs of 2,999 kanji, each table an entry point of its own.

Jisho is the Japanese word 辞書 for a dictionary: this one holds Japanese words and kanji. About the name

Contents

Reference · Stroke order from KanjiVG: draw it, and find a kanji by drawing it

findByDrawingfunction

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 it

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

Definition

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

Parameters

NameTypeDescription
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 (optional){ readonly limit?: number; }

limit, how many to give: 8 unless given.

Returns

DrawingMatch[]

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

Examples

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); // 一
一

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/jisho 2.11.0.