Skip to main content
When something goes wrong, you need to know whether it’s a finding in the text being checked (a validation error the user should fix) or a failure in the library itself (a configuration or resource problem you need to fix). These two cases use separate class hierarchies: Error subclasses in Response.errors for the former, and Python exceptions for the latter.

Spell Checking Errors

These are returned in Response.errors when checking text.

Error Base Class

All spell checking errors inherit from Error:

SyllableError

Invalid syllable detected (Layer 1 validation).
Error Types:

WordError

Invalid word detected (Layer 2 validation).

ContextError

Unlikely word sequence detected (Layer 3 validation).
Semantic Error Types: Semantic errors use MLM predictions to detect unlikely words. Confusable errors flag words that are valid but confused with a similar-looking alternative.

GrammarError

Grammar-related errors from grammar checkers.
Grammar Error Types:

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:

Detection by Validation Layer

Layer 1 - Syllable Validation:
Layer 2 - Word Validation:
Layer 2.5 - Grammar Checking:
Layer 3 - Context Validation:

Medial-Consonant Compatibility

Not all medials are compatible with all consonants:

Stacking Errors

See Also