Skip to main content
Answers to the most common questions about mySpellChecker — from setup and configuration to performance optimization and web framework integration.

General Questions

What is mySpellChecker?

mySpellChecker is a high-performance spell checker specifically designed for Myanmar (Burmese) language text. Unlike English spell checkers that rely on whitespace to identify words, mySpellChecker uses a “Syllable-First Architecture” that validates text at the syllable level first, then progressively validates words and context.

Why was mySpellChecker created?

Myanmar script presents unique challenges for spell checking:
  • No spaces between words
  • Complex syllable structures
  • Multiple valid Unicode representations
  • Legacy Zawgyi encoding still in use
Existing tools either don’t support Myanmar or don’t handle these challenges well.

Is mySpellChecker open source?

Yes, mySpellChecker is open source and available under the MIT license.

What Python versions are supported?

mySpellChecker supports Python 3.10 and later.

Installation

Why does installation take a long time?

mySpellChecker includes Cython extensions that are compiled during installation. This requires a C++ compiler and takes extra time. If you don’t have a compiler, the library will fall back to pure Python implementations (slower but functional).

Do I need a C++ compiler?

No, it’s optional but recommended. Without a compiler:
  • Installation is faster
  • Pure Python fallbacks are used
  • Performance is lower (but still functional)
With a compiler:
  • Installation compiles Cython extensions
  • Performance is significantly better
  • OpenMP parallel processing is available (Linux/macOS)

How do I install on macOS without compiler errors?

# Install Xcode command line tools
xcode-select --install

# For OpenMP support (optional)
brew install libomp

# Then install normally
pip install myspellchecker

Can I install without the optional features?

Yes, install the base package only:
pip install myspellchecker
Optional features are installed separately:
pip install myspellchecker[ai]          # Semantic checking
pip install myspellchecker[transformers] # Transformer POS tagger

Usage

How do I check Myanmar text?

from myspellchecker import SpellChecker

checker = SpellChecker()
result = checker.check("မြန်မာစာ")

if result.has_errors:
    for error in result.errors:
        print(error.text, error.suggestions)

What is the difference between validation levels?

LevelCoverageSpeedUse Case
syllable90% of errors~10msQuick validation
word95% of errors~50msStandard checking
Note: Context checking is enabled via use_context_checker=True parameter, not as a separate validation level.

How do I handle Zawgyi text?

from myspellchecker import SpellChecker
from myspellchecker.core.config import SpellCheckerConfig
from myspellchecker.core.config.validation_configs import ValidationConfig

# Zawgyi detection and conversion are enabled by default
# To explicitly configure:
config = SpellCheckerConfig(
    validation=ValidationConfig(
        use_zawgyi_detection=True,  # Detect Zawgyi encoding
        use_zawgyi_conversion=True,  # Convert to Unicode automatically
    )
)
checker = SpellChecker(config=config)

Can I use a custom dictionary?

Yes, you can build a custom dictionary from your own corpus:
myspellchecker build --input my_corpus.txt --output my_dict.db
Then use it:
from myspellchecker import SpellChecker
from myspellchecker.providers import SQLiteProvider

provider = SQLiteProvider(database_path="my_dict.db")
checker = SpellChecker(provider=provider)

How do I add words to the dictionary at runtime?

Currently, the dictionary is read-only at runtime. To add words:
  1. Add them to your corpus file
  2. Rebuild the dictionary
  3. Restart your application
Runtime dictionary modification is planned for a future release.

Performance

How can I make spell checking faster?

  1. Use syllable-level validation only (fastest):
    from myspellchecker import SpellChecker
    from myspellchecker.core.constants import ValidationLevel
    
    checker = SpellChecker()
    result = checker.check(text, level=ValidationLevel.SYLLABLE)
    
  2. Disable context checking:
    from myspellchecker.core.config import SpellCheckerConfig
    
    config = SpellCheckerConfig(use_context_checker=False)
    checker = SpellChecker(config=config)
    
  3. Use batch processing:
    results = checker.check_batch(texts)  # More efficient than individual calls
    
  4. Ensure Cython is compiled:
    python setup.py build_ext --inplace
    

Why is the first call slow?

The first call initializes the dictionary and loads models into memory. Subsequent calls are much faster. Consider warming up the checker:
checker = SpellChecker()
checker.check("test")  # Warm-up call

How much memory does mySpellChecker use?

ConfigurationMemory Usage
Basic (SQLite provider)~50MB
Memory provider~200MB
With semantic model~500MB
With transformer POS~1GB

Can I use mySpellChecker in a multi-threaded application?

The SpellChecker instance is not thread-safe by default. For multi-threaded use:
  1. Create separate instances per thread
  2. Or use a connection pool for the SQLite provider
  3. Or use the Memory provider (which is thread-safe for reads)

Accuracy

How accurate is mySpellChecker?

Accuracy depends on the validation level and corpus quality:
LevelPrecisionRecallF1
Syllable95%90%92%
Word92%95%93%
Word + Context Checker88%98%93%

Why does it mark valid words as errors?

Common reasons:
  1. Word not in dictionary: Add to custom dictionary
  2. Rare spelling variant: Check corpus coverage
  3. Foreign word: Myanmar text with English/Pali words
  4. Proper noun: Names often flagged as unknown

Why doesn’t it catch obvious errors?

Common reasons:
  1. Real-word error: The misspelling is a valid word (enable use_context_checker=True)
  2. Validation level too low: Increase to word level
  3. Missing grammar rules: Some patterns not covered

How can I improve accuracy?

  1. Build from a larger corpus: More data = better suggestions
  2. Enable context validation: Catches real-word errors
  3. Use semantic checking: Requires AI extras
  4. Report false positives/negatives: Help improve the library

Dictionary Building

How do I build a dictionary?

# From a text file
myspellchecker build --input corpus.txt --output mydict.db

# With POS tagging
myspellchecker build --input corpus.txt --pos-tagger viterbi

What format should my corpus be?

Plain text with Myanmar content:
မြန်မာနိုင်ငံ
ကျေးဇူးတင်ပါသည်
...
Or structured formats (CSV, JSON) with specific columns.

How big should my corpus be?

Corpus SizeCoverageRecommendation
< 100KBBasicTesting only
100KB - 1MBGoodPersonal use
1MB - 10MBVery GoodProduction
> 10MBExcellentProfessional

Can I use multiple corpora?

Yes, use incremental building:
myspellchecker build --input corpus1.txt --output dict.db
myspellchecker build --input corpus2.txt --output dict.db --incremental

Integration

Can I use mySpellChecker in a web application?

Yes, see the Integration Guide for FastAPI, Flask, and Django examples. The library provides check_async() for non-blocking use in async frameworks.

Is there a REST API?

The library doesn’t include a built-in API server, but you can easily create one:
from flask import Flask, request, jsonify
from myspellchecker import SpellChecker

app = Flask(__name__)
checker = SpellChecker()

@app.route('/check', methods=['POST'])
def check():
    text = request.json['text']
    result = checker.check(text)
    return jsonify(result.to_dict())

Can I use it with VS Code?

A VS Code extension is planned for future development. Currently, you can:
  1. Use the CLI for manual checking
  2. Create a custom script that integrates with your editor

Does it work with Django?

Yes, see the Integration Guide for Django service pattern and DRF examples.

Troubleshooting

See Also

Contributing

How can I contribute?

  1. Report bugs via GitHub issues
  2. Submit pull requests for fixes
  3. Improve documentation
  4. Share your custom dictionaries or corpora

Where is the roadmap?

Check the GitHub repository for planned features and roadmap.

How do I report a bug?

Open a GitHub issue with:
  1. Python version
  2. mySpellChecker version
  3. Minimal reproduction code
  4. Expected vs actual behavior