Overview
TheSyllableRuleValidator performs 22 phonotactic checks — from zero-width character rejection through medial compatibility to tone mark rules — entirely without a dictionary. Syllables that pass structural validation then proceed to SyllableValidator for dictionary lookup and suggestion generation.
Architecture
The system uses a dual-implementation pattern:SyllableRuleValidator (syllable_rules.py)
_SyllableRuleValidatorPython: Pure Python fallback
SyllableRuleValidator (from syllable_rules_c): Cython optimized, auto-selected
Validation Pipeline
Layer Flow
SyllableRuleValidator
Initialization
Basic Usage
Validation Rules (22 Checks)
Thevalidate() method performs 22 checks in order:
Phase 1: Basic Checks
Phase 2: Structure Rules
Phase 3: Compatibility Rules
Strict Mode Additional Checks
Whenstrict=True, these additional checks are applied:
Myanmar Syllable Structure
Valid Myanmar syllables follow this pattern:Character Categories
Valid Medial Sequences
Medial Compatibility
Not all consonants can take all medials:Special Patterns
Kinzi (င်္)
Kinzi is a nasalization marker in Pali/Sanskrit loanwords:Stacking (Pat Sint)
Consonant stacking follows Vagga (row) rules:Great Sa (ဿ)
The doubled Sa conjunct has special rules:Integration with SyllableValidator
The rule validator integrates with the full validation pipeline:Performance
Check Implementation
Configuration Options
Strict vs Lenient Mode
- Pali/Sanskrit stacking rules (Vagga logic)
- Canonical character ordering
- Stricter tone mark rules
- Core Myanmar characters only
Extended Myanmar
Error Messages
When validation fails, the check that failed can be identified for debugging:See Also
- Syllable Segmentation - How text is split into syllables
- Word Validation - Layer 2 word-level validation
- Syllable Validation - Syllable structure and validation rules
- Cython Guide - Performance optimization