Error subclasses in Response.errors for the former, and Python exceptions for the latter.
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/Ya-yit confusion |
WordError
Invalid word detected (Layer 2 validation).ContextError
Unlikely word sequence detected (Layer 3 validation).| Type | Source | Description |
|---|---|---|
semantic_error | SemanticStrategy | AI-detected semantic error via MLM |
confusable_error | ConfusableSemanticStrategy | Valid word, wrong in context |
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
MyanmarSpellcheckError (base)
ConfigurationError
InvalidConfigError
DataLoadingError
MissingDatabaseError
ProcessingError
ValidationError
TokenizationError
NormalizationError
ProviderError
ConnectionPoolError
PipelineError
IngestionError
PackagingError
ModelError
ModelLoadError
InferenceError
MissingDependencyError
InsufficientStorageError
CacheError
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:Grouping Exceptions
You can create your own exception 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 | သမတ (“broken stacking”) → သမ္မတ (“president”) |
| 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-yit (ြ) | Ka-group, Pa-group | Tha (သ) |
Stacking Errors
See Also
- Response API - SpellChecker API reference
- Grammar Checkers - Grammar error details
- Configuration - Error handling configuration