lingotweaker-data
v0.2.8
Published
Loader for the LingoTweaker proofreading engine's runtime data packs (the packs ship in per-language lingotweaker-data-<lang> packages)
Maintainers
Readme
LingoTweaker data
Runtime data for the LingoTweaker proofreading engine. This package is the
code-only loader: the actual language packs ship in one small package per
language (lingotweaker-data-<lang>, mirroring the per-language PyPI data
distributions), so npm never has to carry a single multi-language tarball.
Install the loader plus the languages you need:
npm install lingotweaker-data lingotweaker-data-enconst data = require("lingotweaker-data");
const { Engine } = require("lingotweaker");
const engine = new Engine("en-US", { dataDir: data.packPath("en") });
for (const match of engine.check("I can heard you.").matches) {
console.log(match.rule_id, match.suggestions);
}import init, { LtEngine } from "lingotweaker-wasm";
import { packPath } from "lingotweaker-data";
import { readFileSync } from "node:fs";
await init();
const pack = readFileSync(packPath("en"));
const engine = new LtEngine("en-US", pack, JSON.stringify({ today: new Date().toISOString() }));packPath(lang)— absolute path of a language pack, resolved from the installedlingotweaker-data-<lang>package (which must be installed separately; resolution starts next to this package and falls back to the process working directory for pnpm/workspace layouts)languages()— the base codes with a published packdataManifest()— version, upstream commit and per-languagebytes/sha256; thefilepaths are relative to the per-language package
The packs are the same artifacts attached to each GitHub Release
(packs/<lang>.pack.gz) and used by the browser demo, so all channels serve
identical data.
Note for layouts where package resolution cannot reach the per-language
packages from inside this one (strict pnpm), declare
lingotweaker-data-<lang> as a dependency of the consuming package so the
package manager links it.
Vendored rule data, dictionaries and models keep their upstream licenses; see
THIRD_PARTY_NOTICES.md in the repository.
License (packaging code): LGPL-2.1-or-later.
