Skip to main content
Every major component in the checking pipeline is behind an interface: segmenters, dictionary providers, validation strategies, and POS taggers. To customize behavior, implement the corresponding base class and pass your instance to SpellChecker. No monkey-patching or library forks required.

Custom Segmenter

If you have a proprietary segmentation model or want to use a different library:
  1. Subclass Segmenter.
  2. Implement segment_syllables and segment_words.
  3. Pass it to SpellChecker.

BiLSTM Segmenter Example

Custom Dictionary Provider

To load data from a Redis cache, API, or other source:
  1. Subclass DictionaryProvider.
  2. Implement required abstract methods.

Redis Provider Example

REST API Provider Example

Custom Validation Strategies

The ContextValidator uses a strategy pattern for extensible validation.

Creating a Custom Strategy

Strategy Priority Guidelines

Factory Pattern Usage

mySpellChecker uses factories for creating configured components.

Using Component Factory

POS Tagger Factory

Advanced Configuration Patterns

Environment-Based Configuration

Profile-Based Configuration

Programmatic Configuration

Configuration from File