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 · Look words up by reading, written form, English meaning, kanji or romaji

normalizeTextfunction

A text made plain for a lookup: composed and compatibility forms folded together (NFKC, so full-width letters and digits become half-width and half-width kana full-width), whitespace collapsed to single spaces and trimmed, spaces beside Japanese removed, invisible and control characters removed, and a dash between kana, or ending kana, made the long vowel mark ー. Kana are not folded: that is foldKana's. Anything that is not a string, and a text longer than a word can be, gives an empty text.

Import it

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

Definition

function normalizeText(text: string): string

Parameters

NameTypeDescription
textstring

Anything a person typed or pasted.

Returns

string

The plain text; empty when there is nothing to look up.

Examples

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

console.log(normalizeText(" カミ\u200B ")); // カミ
console.log(normalizeText("コーヒ-")); // コーヒー
カミ
コーヒー

What it prints (run when this page was built)

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