How It Works
Syllable Assembly
After syllable validation, valid syllables are assembled into potential words:Dictionary Lookup
Assembled words are checked against the word dictionary:Suggestion Generation
For invalid words, SymSpell generates suggestions in O(1) time:SymSpell Algorithm
mySpellChecker uses the Symmetric Delete algorithm for ultra-fast suggestions:Traditional Approach (Slow)
SymSpell Approach (Fast)
Why It’s Fast
| Operation | Traditional | SymSpell |
|---|---|---|
| Single lookup | O(n × m) | O(1) |
| Scales with dictionary size | Slow (linear) | Very Fast (constant) |
Configuration
Enable Word Validation
Suggestion Settings
SymSpell Configuration
Word Error Types
Unknown Word
Word not found in dictionary:Misspelled Word
Word is close to a valid dictionary entry:Compound Error
Multiple syllable errors forming invalid word:Morphological Synthesis
Before generating errors, word validation checks if an OOV word is a productive formation from known dictionary words. This suppresses false positives on valid compounds and reduplications.Reduplication Validation
Myanmar creates valid words through reduplication (repeating syllables for emphasis):Compound Word Synthesis
Myanmar forms compounds by joining morphemes:Morpheme-Level Suggestions
When a compound word has a typo in one morpheme, the suggestion engine corrects that specific morpheme instead of suggesting unrelated words:Configuration
Suggestion Ranking
Suggestions are ranked by multiple factors:Frequency-Based Ranking
Edit Distance Ranking
Performance Characteristics
| Metric | Value |
|---|---|
| Speed | Fast |
| Lookup Complexity | O(1) average |
| Suggestion Generation | O(k) where k = candidates |
API Reference
Using SpellChecker for Word Validation
WordValidator requires a DI container setup.
For most use cases, use SpellChecker.check() with level=ValidationLevel.WORD.
SymSpell Interface
Common Patterns
Custom Word List
Ignore Unknown Words
Get Top Suggestions Only
Troubleshooting
Issue: Valid words marked as errors
Cause: Word not in dictionary Solution: Add to dictionary:Issue: Poor suggestions
Cause: Low corpus frequency or missing similar words Solution: Improve corpus quality or adjust settings:Issue: Slow suggestion generation
Cause: Large edit distance or dictionary Solution: Reduce max_edit_distance:Next Steps
- Context Checking - Detect real-word errors
- SymSpell Algorithm - Deep dive into SymSpell
- Performance Tuning - Optimization strategies