Error subclasses (returned in Response.errors) for validation findings, and Python exceptions for configuration, resource, and processing failures. This page documents both.
Spell Checking Errors
These are returned inResponse.errors when checking text.
Error Base Class
All spell checking errors inherit fromError:
SyllableError
Invalid syllable detected (Layer 1 validation).| Type | Description |
|---|---|
invalid_syllable | Standard syllable validation error |
particle_typo | Known particle typo (e.g., တယ → တယ်) |
medial_confusion | Ya-pin/Ra-yit confusion |
WordError
Invalid word detected (Layer 2 validation).ContextError
Unlikely word sequence detected (Layer 3 validation).| Type | Source | Description |
|---|---|---|
ai_detected | ErrorDetectionStrategy | Token flagged by AI classifier |
GrammarError
Grammar-related errors from grammar checkers.| Type | Source | Description |
|---|---|---|
aspect_typo | AspectChecker | Verb aspect marker typo |
incomplete_aspect | AspectChecker | Incomplete aspect marking |
invalid_sequence | AspectChecker | Invalid aspect sequence |
typo | ClassifierChecker | Classifier typo (e.g., ယေက် → ယောက်) |
agreement | ClassifierChecker | Classifier-noun agreement error |
compound_typo | CompoundChecker | Compound word typo |
incomplete_reduplication | CompoundChecker | Incomplete reduplication |
typo | NegationChecker | Negation pattern typo |
mixed_register | RegisterChecker | Formal/colloquial mixing |
Response Object
The complete spell checking result:Exceptions
System-level errors for configuration, resources, and processing.Exception Hierarchy
Common Exceptions
MyanmarSpellcheckError
Base exception for all library errors:MissingDatabaseError
Database not found:MissingDependencyError
Optional dependency not installed:ConfigurationError
Invalid configuration:ProcessingError
Text processing failure:ProviderError
Database provider failure:PipelineError
Data pipeline failure:ModelError
ML model failure:Exception Tuples
Pre-defined tuples for consistent error handling:Error Type Constants
Best Practices
1. Catch Specific Exceptions
2. Check Error Types
3. Use Confidence Scores
Common Myanmar Spelling Errors
Error Frequency by Category
Based on corpus analysis:| Error Type | Frequency | Detection Layer | Example |
|---|---|---|---|
| Medial ြ/ျ confusion | 35% | Syllable | ကြောင်/ကျောင် |
| Missing asat | 20% | Syllable | အိမ/အိမ် |
| Vowel length | 15% | Syllable/Word | သု/သူ |
| Particle errors | 12% | Grammar | မှာ/မှ |
| Context (real-word) | 10% | Context | ထမင်းသွား/ထမင်းစား |
| Stacking errors | 5% | Syllable | Kinzi errors |
| Other | 3% | Various | - |
Detection by Validation Layer
Layer 1 - Syllable Validation:Medial-Consonant Compatibility
Not all medials are compatible with all consonants:| Medial | Compatible With | Incompatible With |
|---|---|---|
| Ha-htoe (ှ) | Sonorants (န, မ, လ, etc.) | Stops (က, ခ, ဂ, etc.) |
| Ya-pin (ြ) | Ka-group, Pa-group | Tha (သ) |
Stacking Errors
See Also
- Response API - SpellChecker API reference
- Grammar Checkers - Grammar error details
- Configuration - Error handling configuration