Why GLOST?
The Challenge
Building language learning applications requires representing text with rich annotations: translations, pronunciations, difficulty levels, grammar information, and cultural context.
Common approaches have trade-offs:
- Plain text + offsets: Fragile offset matching, lacks standard structure
- HTML + attributes: Mixes presentation with data, limited structure
- Custom JSON: Each project creates its own format, limiting interoperability
GLOST’s Approach
GLOST provides a standardized syntax tree for multilingual annotated text:
Standards-Based
Built on nlcst (Natural Language Concrete Syntax Tree), part of the unified ecosystem, providing compatibility with existing tools and community-driven standards.
Concrete Syntax Tree
Preserves all details including whitespace and punctuation, which benefits language learners who need to see authentic text.
Multi-Language Support
Supports multiple languages using ISO-639 codes, with flexible script and transcription system handling.
Rich Metadata
Supports comprehensive word annotations:
Extensible
The extension system allows custom processing for features like frequency analysis, translations, and transcriptions.
Type-Safe
Full TypeScript support with type guards for safe node handling.
Use Cases
GLOST is used for language learning apps, reader applications, corpus linguistics, interactive fiction, and dictionary tools.
Comparison
| Feature | GLOST | Plain JSON | HTML |
|---|---|---|---|
| Standard format | Yes | Varies | No |
| Preserves whitespace | Yes | Varies | Partially |
| Multi-language | Yes | Possible | Possible |
| Type-safe | Yes | Possible | No |
| Extensible | Yes | Varies | Limited |
Getting Started
pnpm add @glotblocks/glost @glotblocks/glost-commonSee the Getting Started guide.