Skip to the content

Hikidashi引き出し

Era dates (和暦) and kanji numerals both ways, the dictionary forms of a conjugated word, a reading shared out over its kanji, words pulled from pasted text, and how hard a sentence is to read.

Hikidashi (引き出し) is a drawer: each tool is pulled out when it is wanted. About the name

Contents

Reference · Pasted text

ExtractInputtype

What to read, and the dictionary to read it against: the argument of extractFromText.

Import it

import type { ExtractInput } from "@johnmorrisdotca/hikidashi/extract";

Also exported from: @johnmorrisdotca/hikidashi

Definition

type ExtractInput = {
    text: string;
    known?: KnownWords;
};

Members

NameTypeDescription
textstring

The pasted text, of any length; it is cut to EXTRACT_LIMITS.characters.

known (optional)KnownWords | undefined

The words your dictionary confirmed. Without it, only kanji are found.

Examples

import { extractFromText, type ExtractInput } from "@johnmorrisdotca/hikidashi/extract";

const input: ExtractInput = { text: "毎日、水を飲む。" };
console.log(extractFromText(input).kanji);
[ '毎', '日', '水', '飲' ]

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hikidashi 1.1.0.