Skip to content
lingo

Strictness

Forgiving, confirm, or strict — plus accept, tolerance, escalate.

Prefer the live demos? Open this section in the interactive docs.

One strictness dial sets field personality without changing the grammar. Accept switches, tolerance, and escalate tune the pieces.

  • forgiving: default; assumptions, typos, slang, and ambiguities can succeed with issues.
  • confirm: assumption-class issues escalate to errors and attach a candidate result.
  • strict: confirm plus typo fixing off and number words, fuzzy vocab, approximations, and bare-number assumptions rejected.
import { lingo } from "@pascal-app/lingo"

const result = lingo("5 meterz", {
  kind: "length",
  strictness: "confirm",
})

if (!result.ok && result.candidate?.type === "quantity") {
  result.candidate.quantity.format()
}

Four distinct mechanisms, never merged: strictness (the dial), accept switches (reject whole shapes, keep the candidate), tolerance (how hard the parser tries at typos/ambiguity), and escalate (remap one issue code's severity).

Captions:

  • Strictness comparison: Escalated issues keep their code; only severity moves.
  • Acceptance controls: Switches reject shapes while preserving the candidate parse.
  • Strictness variants: Strictness changes issue severity, not grammar.