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
| Name | Type | Description |
|---|---|---|
characters | 20000 | A chapter is about this long. Past it the paste is cut, and says so. |
wordLength | 8 | The longest run treated as one word. |
candidates | 4000 | 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 }
trueWhat it prints (run when this page was built)