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 fast suggestions:Traditional Approach (Slow)
SymSpell Approach (Fast)
Why It’s Fast
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
Enable/disable morphological synthesis inValidationConfig. Tune algorithm parameters
in the dedicated CompoundResolverConfig and ReduplicationConfig:
Suggestion Ranking
TheDefaultRanker scores suggestions using a multi-factor formula where lower scores indicate better suggestions:
All weights are configurable via
RankerConfig. Alternative rankers (FrequencyFirstRanker, PhoneticFirstRanker, EditDistanceOnlyRanker) emphasize different factors. See Suggestion Ranking for the full algorithm details.
Frequency-Based Ranking
Edit Distance Ranking
Performance Characteristics
Word validation is fast thanks to SymSpell’s pre-computed delete index. Memory usage scales with dictionary size.
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