Design Philosophy
Traditional spell checkers split by whitespace, which fails for Myanmar (no spaces). mySpellChecker inverts the process:- Break into syllables (deterministic, fast)
- Validate syllables (catches ~90% of errors)
- Assemble into words (only with valid syllables)
- Check grammar and context (only with valid words)
High-Level Architecture
Core Components
| Component | Purpose |
|---|---|
| SpellChecker | Main coordinator — orchestrates all validation layers |
| SpellCheckerBuilder | Fluent interface for constructing SpellChecker instances |
| DictionaryProvider | Pluggable storage backend (SQLite, Memory, JSON) |
| Segmenter | Text segmentation (syllable + word) |
| SyllableValidator | Layer 1 — syllable structure validation |
| WordValidator | Layer 2 — word lookup + SymSpell suggestions |
| ContextValidator | Layer 3 — N-gram + validation strategies |
Validation Strategies
The context validation layer uses a Strategy pattern for modular, priority-ordered validation:Offline Systems
Data Pipeline
Transforms raw corpus into optimized dictionary database:Training Pipeline
Creates AI models for semantic checking (BYOM):Design Principles
- Fail Fast — Catch errors at the earliest possible layer
- Layered Validation — Each layer adds accuracy at a cost
- Pluggable Components — Swap providers, segmenters, taggers
- Graceful Degradation — Continue working even if optional components fail
- Performance First — Optimize hot paths with Cython/OpenMP
Architecture Documents
System Design
Detailed component architecture and class responsibilities
Validation Pipeline
Pipeline deep-dive with execution flow
Component Diagram
Visual component relationships
Data Flow
Data flow through the system
Extension Points
How to extend the system
Component Standards
Base classes and patterns
Dependency Injection
DI container system