`parse-latin` is a JavaScript library designed for parsing natural language written in Latin-script languages, producing a Natural Language Concrete Syntax Tree (NLCST). It is currently at version 7.0.0, with a release cadence that includes regular patch and minor updates, and significant breaking changes between major versions, often related to ecosystem standards (like ESM-only) or core API adjustments. Key differentiators include its ability to precisely tokenize and structure text from diverse Latin-script languages such as Old English, Icelandic, French, and German, by correctly handling complex punctuation, word boundaries, and sentence structures. Unlike higher-level abstractions like `retext-latin`, `parse-latin` provides a lower-level API for manual manipulation of syntax trees. It explicitly handles nuances like hyphenated words, contractions (e.g., 'she’s'), and periods that don't signify sentence endings (e.g., in abbreviations), making it robust for detailed linguistic analysis and processing.
npm install parse-latinVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to initialize `ParseLatin` and parse a sample Latin-script string into an NLCST syntax tree, then logs the inspected tree structure.
Upgrade your Node.js environment to version 16 or newer.
Refactor your imports to use ES Modules syntax (`import`/`export`). Ensure your project is configured for ESM by setting `"type": "module"` in `package.json` or using `.mjs` file extensions.
If you relied on positional information, use `unist-util-position` to add it back to the tree. If you previously set `position: false`, this change aligns with that behavior.
Manually manage your plugin lists or middleware for tree manipulation outside of the `ParseLatin` constructor.
Only import public APIs from the package as documented. Avoid deep imports into internal paths or undocumented modules.
Update any code that checks the `doc` field to explicitly expect `undefined` instead of other falsy values.
Change `const { ParseLatin } = require('parse-latin')` to `import { ParseLatin } from 'parse-latin'`. Ensure Node.js 16+ is used and `package.json` specifies `"type": "module"`.Instantiate the parser using `const parser = new ParseLatin();` before calling `parser.parse(value)`.
Ensure your `package.json` contains `"type": "module"` or that your file has a `.mjs` extension. For older Node.js environments, consider transpiling.
Install `unist-util-inspect` separately: `npm install unist-util-inspect`.
No dependency data recorded yet.