@leiden-js/parser-leiden-trans
v1.0.5
Published
A Lezer based parser for Leiden Translation
Downloads
16
Readme
@leiden-js/parser-leiden-trans
Part of leiden-js, a set of packages for working with the Leiden notation systems used in epigraphic digital editing within JavaScript environments.
Lezer-based parser for Leiden Translation notation, generating syntax trees for Leiden Translation notation system used in translations of ancient texts.
Installation
npm install @leiden-js/parser-leiden-transUsage
import { parser } from "@leiden-js/parser-leiden-trans";
const text = "((1)) example translation〚text〛";
const tree = parser.parse(text);
// With custom top node
const tree = parser.configure({ top: "InlineContent" }).parse(text);
console.log(tree.toString());Top Node Options
The parser supports different entry points:
Document(default) - Complete document structureBlockContent- Block-level content onlySingleTranslation- Single translation blockSingleDiv- Single divisionSingleP- Single paragraphInlineContent- Inline content only
Related Packages
@leiden-js/codemirror-lang-leiden-trans- CodeMirror language integration@leiden-js/linter-leiden-trans- Linting for syntax trees produces by this parser@leiden-js/transformer-leiden-trans- Transformations using this parser
