Skip to Content
DocumentationPlugins Guide

GLOST Plugins: Complete Guide

What Are Plugins?

Plugins add powerful capabilities to GLOST documents:

  • Generate metadata from external sources (frequency, difficulty, POS tags)
  • Transform structure by adding/removing/segmenting nodes
  • Enhance display with colors, labels, and visual cues
  • Analyze content using data from multiple sources

Available Plugins

5 Core Feature Plugins

Each has a comprehensive guide with real examples and working demos:

PluginPurposeGuide
🔢 FrequencyVocabulary prioritizationGuide
📝 POSGrammar visualizationGuide
📊 DifficultyText levelingGuide
⚤ GenderArticle selectionGuide
🔗 Clause SegmenterSentence breakdownGuide

Additional Analyzers & Transformers

Built into @glotblocks/glost-plugins:

  • ReadingScorePlugin - Overall text readability
  • LearnerHintsPlugin - Contextual learning hints
  • ClauseAnalysisPlugin - Clause relationship analysis
  • GenderTransformerPlugin - Gender-specific transformations
  • NegationTransformerPlugin - Negation pattern identification
  • CulturalNotesPlugin - Cultural context enrichment

Guide Structure

Each guide follows “Show, Don’t Tell” with:

📖 Real Use Cases

Actual scenarios from language learning apps, reading platforms, and educational tools

📊 Before/After Comparisons

See the transformation:

Before: "The ephemeral nature of social media posts makes archival challenging" (All words look the same) After: ■■■■ "the" → Very Common (learn first) ■□□□ "ephemeral" → Rare (learn last)

💾 Real Data Examples

  • British National Corpus (frequency)
  • Stanford CoreNLP (POS)
  • CEFR word lists (difficulty)
  • Validated dictionaries (gender)
  • Penn Treebank rules (clauses)

📈 Measurable Value

  • “40% faster reading comprehension” (clause segmentation)
  • “Focus on 20% of vocabulary for 80% comprehension” (frequency)
  • “Automatic text leveling with 95% accuracy” (difficulty)

💻 Working Code

Copy-paste examples you can run immediately

Quick Navigation

I want to…

…understand a specific plugin → Read its guide: See the table above

…see working examples → Run demos: npm run examples (see examples )

…migrate existing code → Read: Migration Guide

…understand the philosophy → Read: Provider Philosophy

…implement a provider → See guide examples + language packages (glost-th/extensions, glost-ja/extensions)

Getting Started (3 Steps)

1. Choose a Plugin

Based on your use case:

  • Vocabulary learning? → Frequency + Difficulty
  • Grammar teaching? → POS + Gender
  • Reading comprehension? → Clause Segmenter + Difficulty
  • Writing assistance? → POS + Clause Segmenter
  • All of the above? → Use multiple plugins together

2. Read the Guide

Each guide shows:

  • Real-world scenarios
  • Expected input/output
  • UI integration examples
  • Data requirements
  • Performance characteristics

Start here: Guides Index

3. Run the Demo

See it in action:

cd examples npm install npm run example:frequency # Or any other demo

Expected output:

╔════════════════════════════════════════╗ ║ FREQUENCY PLUGIN DEMO ║ ╚════════════════════════════════════════╝ Input: "The ephemeral nature of social media..." ■■■■ "the" → Very Common (6M occurrences) ■□□□ "ephemeral" → Rare (43 occurrences) Recommendation: Focus on 6 common words first

How Guides Demonstrate Value

Frequency Plugin Guide

Shows:

Text: "The ephemeral nature of social media posts..." With frequency data: • Learner sees: "the" (very common) vs "ephemeral" (rare) • Learns high-impact vocabulary first (80/20 rule) • Text difficulty assessed: "Intermediate (20% rare words)" Value: Prioritized learning path based on real usage data

POS Plugin Guide

Shows:

Text: "The quick brown fox jumps over the lazy dog" With POS tagging: [Art] [Adj] [Adj] [N] [V] [Prep] [Art] [Adj] [N] Patterns visible: • Adjective + Noun: "quick fox", "brown fox", "lazy dog" • Sentence structure: [NP] [V] [PP] Value: Grammar patterns become teachable

Difficulty Plugin Guide

Shows:

Three texts analyzed: 🟢 "I go to school" → Beginner (100% A1 words) 🟡 "Government announced..." → Intermediate (60% B1 words) 🔴 "Aforementioned protocol..." → Advanced (44% C1+ words) Value: Automatic leveling for adaptive learning

Gender Plugin Guide

Shows:

French nouns with gender: ♂ "chat" (masculine) → use "le" not "la" ✓ ♀ "maison" (feminine) → use "la" not "le" ✓ Pattern discovered: "-tion" endings are 96% feminine Value: Master article selection with visual reinforcement

Clause Segmenter Guide

Shows:

Complex sentence: "The student who studied hard passed the exam because she understood" Segmented: [Main] The student passed the exam (core meaning) [Relative] who studied hard (which student?) [Causal] because she understood (why passed?) Value: 40% faster comprehension of complex sentences

Provider Pattern

Plugins use providers to access language-specific data:

// Plugin package (glost-frequency) interface FrequencyProvider { getFrequency(word: string, lang: string): Promise<number | undefined>; } // Language package (glost-th/extensions) export const thaiFrequencyProvider: FrequencyProvider = { async getFrequency(word, lang) { return thaiNationalCorpus.lookup(word); } }; // Your app import { processGLOSTWithExtensionsAsync } from "@glotblocks/glost-plugins"; import { createFrequencyExtension } from "@glotblocks/glost-frequency"; import { thaiFrequencyProvider } from "@glotblocks/glost-th/extensions"; const [freqGen, freqEnh] = createFrequencyExtension({ targetLanguage: "th", provider: thaiFrequencyProvider }); const result = await processGLOSTWithExtensionsAsync(doc, [freqGen, freqEnh]);

Benefits:

  • ✅ One plugin works for all languages
  • ✅ Data stays in language packages (single source of truth)
  • ✅ Easy to swap data sources
  • ✅ Clear separation of concerns

Philosophy: No Data > Bad Data

Key principle: Plugins return undefined when data is unavailable.

We DO NOT use:

  • ❌ Length-based heuristics (“long words are rare”)
  • ❌ Pattern guessing (“words ending in -ing are verbs”)
  • ❌ Arbitrary fallbacks
  • ❌ Single-source assumptions

We DO use:

  • ✅ Validated corpora (BNC, TNK, JNC)
  • ✅ NLP models (Stanford, spaCy)
  • ✅ Official standards (CEFR, JLPT)
  • ✅ Verified dictionaries

Result: High accuracy or graceful degradation. Never misleading data.

📖 Read: Provider Philosophy

Running Examples

cd examples # Single demo npm run example:frequency # All demos (takes ~750ms) npm run examples

Each demo outputs:

  1. Input text
  2. Word-by-word analysis
  3. Visual representation
  4. Measurable value demonstrated

📖 See: Examples 

Real-World Applications

Language Learning Apps

  • Duolingo-style: Frequency for vocabulary selection
  • Grammar exercises: POS for pattern drills
  • Adaptive content: Difficulty for text recommendations

Digital Reading Platforms

  • Word highlighting: Frequency-based colors
  • Sentence simplification: Clause segmentation
  • Level assessment: Difficulty analysis

Writing Assistants

  • Grammar checking: POS + clause analysis
  • Style suggestions: Clause complexity
  • Vocabulary enhancement: Frequency alternatives

Educational Analytics

  • Progress tracking: Difficulty level progression
  • Vocabulary coverage: Frequency distribution
  • Reading assessment: Multiple plugin combination

Performance

PluginPer WordPer SentenceData Load
Frequency~1ms~10ms~10ms
POS~2ms~20ms~50ms
Difficulty~1ms~10ms~20ms
Gender~1ms~10ms~15ms
Clause Segmenter-~5ms~5ms

Combined pipeline: ~10ms per sentence for all plugins

Documentation Index

Core Concepts

Guides

Migration & Technical

Package Documentation

Contributing

Found a better use case? Have real data for a language?

  1. Read a plugin guide
  2. Run the demo
  3. Implement a provider for your language
  4. Add examples to the guide
  5. Submit a PR

See CONTRIBUTING.md  for guidelines.

Next Steps

  1. 📖 Read a guide - Pick one from the table at top
  2. 💻 Run a demo - npm run example:[name]
  3. 🔍 Explore code - See examples/ and packages/plugins/
  4. 🏗️ Build provider - Implement for your language
  5. 🚀 Integrate - Use in your application

Remember: Plugins are optional. Use only what adds value. The core GLOST format works perfectly standalone.

Philosophy: Show real value with real data, or don’t use a plugin at all.

Last updated on