Basic Installation
Using pip (Recommended)
- Syllable validation
- Word validation with SymSpell
- Context checking with N-grams
- SQLite dictionary provider
- CLI tools
Verify Installation
Dictionary Database
mySpellChecker requires a dictionary database for spell checking. No bundled database is included — you must build one first.Providing a Database
Pass the database path explicitly:- Use
SQLiteProvider(database_path="/path/to/db.db") - Or use CLI flag:
myspellchecker check --db /path/to/db.db - Or set in config file:
database: /path/to/db.db - Or set environment variable:
MYSPELL_DATABASE_PATH(via ConfigLoader)
Building a Sample Database
Building from Corpus
Installation Options
With AI/Semantic Features
For deep learning-based context checking:- ONNX Runtime for semantic model inference
- Tokenizers library for fast text tokenization
- Pre-trained semantic models support
With Transformer POS Tagger
For highest accuracy POS tagging (~93%):- PyTorch
- Hugging Face Transformers
- Pre-trained Myanmar POS models support
Full Installation
Install complete AI features (Semantic + Transformer POS):ai + transformers
Development Installation
For contributors and developers:- pytest and testing tools
- ruff for linting/formatting
- mypy for type checking
- Note: Cython is automatically installed as a build dependency, not part of the [dev] extra.
Platform-Specific Instructions
Linux (Ubuntu/Debian)
Linux (RHEL/CentOS/Fedora)
macOS
libomp, Cython extensions will compile without parallel processing. The library will still work but batch processing will be single-threaded.
Windows
Virtual Environment Setup
We recommend using a virtual environment:Using venv
Using conda
Using Poetry
Building from Source
For development or to get the latest features:Clone and Install
Development Dependencies
The development installation includes:| Tool | Purpose |
|---|---|
| pytest | Testing framework |
| pytest-cov | Coverage reporting |
| pytest-benchmark | Performance benchmarks |
| ruff | Linting and formatting |
| mypy | Static type checking |
Note: Cython is automatically installed as a build-system dependency (specified inpyproject.tomlbuild requirements), not as part of the[dev]extra.
Running Tests
Cython Extension Compilation
Cython extensions provide significant performance improvements. They’re automatically compiled during installation, but if you modify.pyx files:
Troubleshooting Cython Build
Missing C++ Compiler:Verifying Installation
Run this script to verify all components are installed correctly:Common Issues
Issue: “No module named ‘myspellchecker’”
Solution: Ensure you’re in the correct virtual environment:Issue: “Database not found”
Solution: Build or download a dictionary database:Issue: “Cython extension failed to compile”
Solution: Install a C++ compiler:Issue: “OpenMP not found” (macOS)
Solution: Install libomp:Docker Installation
For containerized deployments, mySpellChecker provides Docker support with multi-stage builds.Quick Start with Docker Compose
Available Docker Services
| Service | Command | Description |
|---|---|---|
api | docker compose up api | Production API server |
dev | docker compose --profile dev up dev | Development with hot reload |
cli | docker compose --profile cli run --rm cli check "မြန်မာစာ" | CLI tool |
test | docker compose --profile test run --rm test | Run tests |
api-gpu | docker compose --profile gpu up api-gpu | GPU-enabled API |
Building Docker Images
Next Steps
- Dictionary Building - Build a dictionary database (required before spell checking)
- Quick Start - Learn the basics in 5 minutes
- Configuration - Customize behavior