Skip to Content

glost-presets

Pre-configured plugin combinations for common use cases.

Installation

npm install @glotblocks/glost-presets @glotblocks/glost-core @glotblocks/glost-processor

Or use the main glost package which includes presets:

npm install @glotblocks/glost

Features

  • Ready-to-use plugin combinations
  • Optimized for specific use cases
  • Easy to extend and customize
  • TypeScript support

Quick Start

import { glost } from '@glotblocks/glost'; import { languageLearningPreset } from '@glotblocks/glost/presets'; const processor = glost() .use(languageLearningPreset) .freeze(); const result = await processor.process(document);

Available Presets

languageLearningPreset

Comprehensive preset for language learning applications.

Includes:

  • Frequency analysis
  • Difficulty scoring
  • Part-of-speech tagging
  • Transcription support
import { languageLearningPreset } from '@glotblocks/glost/presets'; const processor = glost() .use(languageLearningPreset) .freeze();

Best for:

  • Vocabulary learning apps
  • Flashcard systems
  • Graded readers
  • Language courses

readingAppPreset

Optimized for reading comprehension platforms.

Includes:

  • Clause segmentation
  • Difficulty scoring
  • Translation support
import { readingAppPreset } from '@glotblocks/glost/presets'; const processor = glost() .use(readingAppPreset) .freeze();

Best for:

  • Digital reading platforms
  • News readers
  • Book apps
  • Article processors

vocabularyBuilderPreset

Focused on vocabulary acquisition.

Includes:

  • Frequency analysis
  • Difficulty scoring
  • Spaced repetition metadata
import { vocabularyBuilderPreset } from '@glotblocks/glost/presets'; const processor = glost() .use(vocabularyBuilderPreset) .freeze();

Best for:

  • Vocabulary trainers
  • Word lists
  • Study apps
  • SRS systems

grammarAnalyzerPreset

For grammar analysis and teaching.

Includes:

  • Part-of-speech tagging
  • Clause segmentation
  • Grammatical gender (where applicable)
import { grammarAnalyzerPreset } from '@glotblocks/glost/presets'; const processor = glost() .use(grammarAnalyzerPreset) .freeze();

Best for:

  • Grammar exercises
  • Sentence analysis
  • Writing tools
  • Language study

minimalPreset

Lightweight preset with basic functionality.

Includes:

  • Basic node processing
  • No external data dependencies
import { minimalPreset } from '@glotblocks/glost/presets'; const processor = glost() .use(minimalPreset) .freeze();

Best for:

  • Quick prototyping
  • Testing
  • Simple document processing

Preset Comparison

PresetFrequencyDifficultyPOSTranscriptionSegmentationTranslation
languageLearningPreset✓✓✓✓--
readingAppPreset-✓--✓✓
vocabularyBuilderPreset✓✓----
grammarAnalyzerPreset--✓-✓-
minimalPreset------

Extending Presets

Add additional plugins to a preset:

import { glost } from '@glotblocks/glost'; import { languageLearningPreset } from '@glotblocks/glost/presets'; import { myCustomPlugin } from './my-plugin'; const processor = glost() .use(languageLearningPreset) .use(myCustomPlugin) // Add custom plugin .freeze();

Creating Custom Presets

Define your own preset:

import type { Preset } from '@glotblocks/glost-presets'; import { createFrequencyExtension } from '@glotblocks/glost-frequency'; import { createPosExtension } from '@glotblocks/glost-pos'; export const myCustomPreset: Preset = { name: 'my-custom-preset', description: 'Custom preset for my app', plugins: [ ...createFrequencyExtension({ ... }), ...createPosExtension({ ... }) ] }; // Use it const processor = glost() .use(myCustomPreset) .freeze();

Preset with Options

Some presets accept configuration:

import { createLanguageLearningPreset } from '@glotblocks/glost/presets'; const customPreset = createLanguageLearningPreset({ targetLanguage: 'th', includeFrequency: true, includeDifficulty: true, includePOS: false // Disable POS tagging }); const processor = glost() .use(customPreset) .freeze();

TypeScript

import type { Preset, PresetOptions } from '@glotblocks/glost-presets';

See Also

Last updated on