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

sanitizePastedTextfunction

The text as it will be read: control and invisible characters (and line and paragraph separators) turned into spaces, then cut to EXTRACT_LIMITS.characters.

Import it

import { sanitizePastedText } from "@johnmorrisdotca/hikidashi/extract";

Also exported from: @johnmorrisdotca/hikidashi

Definition

function sanitizePastedText(raw: string): { text: string; truncated: boolean; }

Parameters

NameTypeDescription
rawstring

The pasted text, of any length.

Returns

{ text: string; truncated: boolean; }

The cleaned text, and whether it was cut.

Examples

import { sanitizePastedText } from "@johnmorrisdotca/hikidashi/extract";

console.log(sanitizePastedText("水\u0000を\u200b飲む"));
{ text: '水 を 飲む', truncated: false }

What it prints (run when this page was built)

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