Skip to main content
Install the library, build a dictionary from your corpus, and run your first spell check, all in a few lines of Python.
Prerequisite: You must build a dictionary database before spell checking will work. mySpellChecker does not include a bundled dictionary.

Setup

Before checking spelling, you need a dictionary database:
This creates ./mySpellChecker-default.db in the current directory. For production, build from your own corpus:

Your First Spell Check

Quick Check (One-liner)

Standard Usage

Understanding Results

The check() method returns a Response object:

Error Types

mySpellChecker identifies several types of errors:

Validation Levels

Control the depth of checking with validation levels at check time:
Note: Validation level is specified per-check via the level parameter, not in configuration.

Getting Suggestions

Access correction suggestions for errors:

Batch Processing

Process multiple texts efficiently:

Async Processing

For web applications and async workflows:

Using with FastAPI

Context Manager Usage

Ensure proper resource cleanup:

Custom Database

Use your own dictionary database:

Configuration Presets

Use built-in presets for common scenarios:
Available profiles: "development", "production", "testing", "fast", "accurate"

CLI Usage

Check text from command line:

Colloquial Handling

Control how colloquial (informal) spellings are handled:

Localized Error Messages

Display error messages in Myanmar:

Streaming Large Files

Process large files with bounded memory:

Text Normalization

Always normalize input for consistent results:

Zawgyi Detection

Handle legacy Zawgyi encoding:

Error Handling

Handle errors gracefully with specific exception types:

Summary Table

Next Steps