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

EXTRACT_LIMITSconstant

What a paste is held to: read to 20,000 characters and then cut, words of up to 8 characters, and at most 4,000 candidates asked of a dictionary.

Import it

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

Also exported from: @johnmorrisdotca/hikidashi

Definition

const EXTRACT_LIMITS: { readonly characters: 20000; readonly wordLength: 8; readonly candidates: 4000; } = {
    characters: 20000,
    wordLength: 8,
    candidates: 4000,
} as const

Members

NameTypeDescription
characters20000

A chapter is about this long. Past it the paste is cut, and says so.

wordLength8

The longest run treated as one word.

candidates4000

How many distinct candidates a paste may ask the dictionary about.

Examples

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

console.log(EXTRACT_LIMITS);
console.log(sanitizePastedText("あ".repeat(EXTRACT_LIMITS.characters + 5)).truncated);
{ characters: 20000, wordLength: 8, candidates: 4000 }
true

What it prints (run when this page was built)

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