Skip to main content
After syllable-level checks pass, assembled syllable sequences are looked up against the dictionary. Unknown words get correction suggestions generated via the SymSpell algorithm, ranked by edit distance and frequency.

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):
Supported patterns: AA, AABB, ABAB, RHYME (known pairs). Safeguards: base must be in dictionary, frequency >= 5, POS must be V/ADJ/ADV/N.

Compound Word Synthesis

Myanmar forms compounds by joining morphemes:
Uses dynamic programming to find optimal splits. Allowed patterns: N+N, V+V, N+V, V+N, ADJ+N. Blocked: P+P, P+N, N+P.

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 in ValidationConfig. Tune algorithm parameters in the dedicated CompoundResolverConfig and ReduplicationConfig:

Suggestion Ranking

The DefaultRanker scores suggestions using a multi-factor formula where lower scores indicate better suggestions:
The base score starts at the edit distance, optionally scaled by a plausibility multiplier derived from Myanmar-weighted substitution costs (e.g., aspirated pairs and medial confusions get lower costs). Then several bonuses are subtracted: 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

Note: Direct instantiation of 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