Skip to main content
Layer 1 of the validation pipeline catches approximately 90% of spelling errors by validating Myanmar syllable structure against orthographic rules before dictionary lookup.

Overview

The SyllableRuleValidator 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
At runtime, the Cython version is used if available, providing ~8x speedup.

Validation Pipeline

Layer Flow

SyllableRuleValidator

Initialization

Basic Usage

Validation Rules (22 Checks)

The validate() method performs 22 checks in order:

Phase 1: Basic Checks

Phase 2: Structure Rules

Phase 3: Compatibility Rules

Strict Mode Additional Checks

When strict=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

Strict mode enforces:
  • 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