Why Syllable-First?
Myanmar text has unique characteristics:- No whitespace between words
- Syllable-based writing system
- Words are composed of one or more syllables
- Expensive computationally
- Error-prone on misspelled text
- Wasteful when obvious typos exist
- Break text into syllables first (fast, deterministic)
- Validate syllables (catches 90%+ of typos immediately)
- Only assemble valid syllables into words for deeper checking
Syllable Anatomy
A Myanmar syllable follows this pattern:| Component | Required | Position | Examples |
|---|---|---|---|
| Consonant | Yes | Initial | က, ခ, မ |
| Stacked | No | After consonant | ္က, ္ခ |
| Medial | No | After consonant | ျ, ြ, ွ, ှ |
| Vowel | No | Various | ါ, ိ, ု, ေ |
| Final | No | End | ်, ံ, း |
Simple Syllables
Note: Tonal information is omitted from these transcriptions for simplicity. Standard Burmese has four tones (low, high, creaky, checked).
Complex Syllables (with Medials)
Common Syllable Patterns
| Pattern | Example | Phonetic |
|---|---|---|
| CV (Consonant + Vowel) | မာ, နေ, သူ | ma, ne, thu |
| CVC (Consonant + Vowel + Consonant) | ကန်, သင်, ကိန်း | kan, thin, kein: |
| CMV (Consonant + Medial + Vowel) | မြေ, ကျော်, ကြီး | mye, kyaw, kyi: |
| Complex | ကြောင်, မြန်မာ | kyaung, myanma |
How It Works
Rule-Based Validation
Each syllable is checked against 5 structural rules:Rule 1: Must start with consonantRule 2: Medials in correct order (Ya < Ra < Wa < Ha)Rule 3: No duplicate medialsRule 4: Vowel compatibilityRule 5: Finals at end position
Stacked Consonants
Kinzi (special stacking with င):Configuration
Enable/Disable Syllable Validation
Syllable Rule Configuration
Syllable Error Types
Invalid Structure
Syllable doesn’t follow Myanmar orthographic rules:Unknown Syllable
Valid structure but not in dictionary:Medial Confusion
Common error with similar-looking medials:Performance Characteristics
| Metric | Value |
|---|---|
| Speed | Very Fast |
| Time Complexity | O(n) where n = syllable count |
| Lookup Complexity | O(1) per syllable |
API Reference
Using SpellChecker for Syllable Validation
SyllableValidator requires a DI container setup.
For most use cases, use SpellChecker.check() instead.
SyllableRuleValidator
Common Patterns
Real-Time Validation
Syllable-Only Suggestions
Troubleshooting
Issue: Valid syllables marked as errors
Cause: Syllable not in dictionary Solution: Add to custom dictionary or update database:Issue: Slow syllable validation
Cause: Missing Cython extensions Solution: Rebuild extensions:Issue: Incorrect syllable segmentation
Cause: Complex stacked consonants or rare characters Solution: Use custom segmenter or report issue:Next Steps
- Word Validation - Next level of validation
- Algorithm Details - Deep dive into segmentation
- Performance Tuning - Optimization strategies