Documentation Index
Fetch the complete documentation index at: https://docs.myspellchecker.com/llms.txt
Use this file to discover all available pages before exploring further.
Organized by category. Find your issue below and follow the solution. If your problem isn’t covered, see Getting More Help at the bottom.
Installation Issues
Issue: Cython compilation fails
Symptoms:
error: Microsoft Visual C++ 14.0 or greater is required
or
error: command 'gcc' failed with exit status 1
Cause: Missing C++ compiler for Cython extensions.
Solution:
Windows:
# Install Visual C++ Build Tools
# Download from: https://visualstudio.microsoft.com/visual-cpp-build-tools/
macOS:
Linux:
sudo apt-get install build-essential python3-dev # Debian/Ubuntu
sudo yum install gcc gcc-c++ python3-devel # RHEL/CentOS
Alternative: Install without Cython (slower but works):
pip install myspellchecker --no-build-isolation
Issue: OpenMP not found on macOS
Symptoms:
clang: error: unsupported option '-fopenmp'
Cause: macOS clang doesn’t include OpenMP by default.
Solution:
brew install libomp
export LDFLAGS="-L/opt/homebrew/opt/libomp/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libomp/include"
pip install myspellchecker --force-reinstall
Or install without OpenMP (parallel processing disabled):
DISABLE_OPENMP=1 pip install myspellchecker
Issue: pip install hangs
Symptoms: Installation appears to freeze during Cython compilation.
Cause: Compiling large Cython files takes time, especially on slower systems.
Solution:
- Wait longer (up to 10 minutes on slow systems)
- Check CPU usage to confirm compilation is active
- Try installing with verbose output:
pip install myspellchecker -v
Issue: Module not found after installation
Symptoms:
ModuleNotFoundError: No module named 'myspellchecker'
Cause: Wrong Python environment or failed installation.
Solution:
# Check Python environment
which python
python --version
# Verify installation
pip show myspellchecker
# Reinstall if needed
pip uninstall myspellchecker
pip install myspellchecker
Database Issues
Issue: Database not found
Symptoms:
MissingDatabaseError: Database not found at path
Cause: Default database doesn’t exist or path is wrong.
Solution:
-
Build the database:
myspellchecker build --sample # Creates sample database
-
Specify correct path:
from myspellchecker import SpellChecker
from myspellchecker.providers import SQLiteProvider
provider = SQLiteProvider(database_path="/path/to/your/database.db")
checker = SpellChecker(provider=provider)
Issue: Database locked
Symptoms:
sqlite3.OperationalError: database is locked
Cause: Multiple processes accessing the same SQLite database.
Solution:
- Use different database instances for each process
- Use Memory provider for multi-process scenarios:
from myspellchecker.providers import MemoryProvider
checker = SpellChecker(provider=MemoryProvider())
- Increase SQLite timeout:
from myspellchecker.providers import SQLiteProvider
provider = SQLiteProvider(database_path=db_path, sqlite_timeout=60)
Issue: Database corrupted
Symptoms:
sqlite3.DatabaseError: database disk image is malformed
Cause: Interrupted write operation or disk error.
Solution:
# Rebuild the database
myspellchecker build --input corpus.txt --output new_dict.db
# Or recover using sqlite3
sqlite3 corrupted.db ".recover" | sqlite3 recovered.db
Issue: Spell checking is slow
Symptoms: Checking takes >1 second for short text.
Cause: Various factors affecting performance.
Solutions:
-
Check Cython compilation:
python setup.py build_ext --inplace
-
Use faster validation level (per-check):
from myspellchecker.core.constants import ValidationLevel
result = checker.check(text, level=ValidationLevel.SYLLABLE)
-
Disable context checking:
config = SpellCheckerConfig(use_context_checker=False)
-
Use batch processing:
results = checker.check_batch(texts) # Much faster for multiple texts
-
Warm up the checker:
checker = SpellChecker()
checker.check("warmup") # Load everything into memory
Issue: High memory usage
Symptoms: Application uses excessive RAM.
Cause: Memory provider or large models loaded.
Solutions:
-
Use SQLite provider (default):
from myspellchecker import SpellChecker
from myspellchecker.providers import SQLiteProvider
provider = SQLiteProvider(database_path="/path/to/dictionary.db")
checker = SpellChecker(provider=provider)
-
Disable semantic checking:
from myspellchecker.core.config import SpellCheckerConfig, SemanticConfig
config = SpellCheckerConfig(
semantic=SemanticConfig(use_semantic_refinement=False)
)
-
Use lighter POS tagger:
from myspellchecker.core.config import SpellCheckerConfig, POSTaggerConfig
config = SpellCheckerConfig(
pos_tagger=POSTaggerConfig(tagger_type="viterbi")
)
Issue: Batch processing crashes
Symptoms:
MemoryError: Unable to allocate array
Cause: Trying to process too many texts at once.
Solution:
# Process in smaller batches
def chunked_check(texts, batch_size=100):
results = []
for i in range(0, len(texts), batch_size):
batch = texts[i:i + batch_size]
results.extend(checker.check_batch(batch))
return results
Validation Issues
Issue: Valid word marked as error
Symptoms: Known correct words flagged as unknown.
Cause: Word not in dictionary.
Solutions:
-
Check if word is in dictionary:
from myspellchecker.providers import SQLiteProvider
provider = SQLiteProvider(database_path="/path/to/dictionary.db")
exists = provider.is_valid_word("မြန်မာ")
-
Add to custom dictionary: Rebuild with expanded corpus
-
Lower phonetic suggestion threshold:
from myspellchecker.core.config import SpellCheckerConfig, PhoneticConfig
config = SpellCheckerConfig(
phonetic=PhoneticConfig(suggestion_threshold_unseen=0.0005)
)
Issue: Errors not detected
Symptoms: Misspelled words pass validation.
Cause: Validation level too low or real-word error.
Solutions:
-
Enable context checking:
from myspellchecker.core.config import SpellCheckerConfig
from myspellchecker.core.constants import ValidationLevel
config = SpellCheckerConfig(use_context_checker=True)
checker = SpellChecker(config=config)
result = checker.check(text, level=ValidationLevel.WORD)
-
Enable rule-based validation:
config = SpellCheckerConfig(use_rule_based_validation=True)
Issue: Wrong suggestions
Symptoms: Suggestions are irrelevant or incorrect.
Cause: Edit distance too high or corpus mismatch.
Solutions:
-
Reduce max edit distance:
config = SpellCheckerConfig(max_edit_distance=1) # Default is 2
-
Increase suggestion count:
config = SpellCheckerConfig(max_suggestions=10)
-
Build domain-specific dictionary: Use corpus matching your content type
Encoding Issues
Issue: Zawgyi text not detected
Symptoms: Zawgyi text processed as Unicode (garbled output).
Cause: Detection confidence too low.
Solutions:
-
Lower detection threshold:
from myspellchecker.text.normalize import detect_encoding
encoding, confidence = detect_encoding(text)
if confidence > 0.6: # Lower threshold
# Handle as Zawgyi
-
Force Zawgyi conversion:
from myspellchecker.text.normalize import convert_zawgyi_to_unicode
unicode_text = convert_zawgyi_to_unicode(text) # Force conversion
Issue: Unicode normalization problems
Symptoms: Same-looking text gives different results.
Cause: Non-normalized Unicode text.
Solution:
from myspellchecker.text.normalize import normalize
# Always normalize before checking
normalized = normalize(text)
result = checker.check(normalized)
Issue: Mixed encoding in text
Symptoms: Partial garbled output.
Cause: Text contains both Unicode and Zawgyi.
Solution:
from myspellchecker.text.normalize import detect_encoding, convert_zawgyi_to_unicode
# Detect and convert if needed
encoding, confidence = detect_encoding(text)
if encoding == "zawgyi" and confidence > 0.5:
text = convert_zawgyi_to_unicode(text)
result = checker.check(text)
Model Issues
Issue: Semantic model fails to load
Symptoms:
ModelLoadError: Failed to load semantic model
Cause: Missing ONNX runtime or model file.
Solutions:
-
Install ONNX runtime:
-
Check model file exists:
import os
model_path = config.semantic.model_path
if model_path:
print(os.path.exists(model_path))
-
Disable semantic checking:
from myspellchecker.core.config import SpellCheckerConfig, SemanticConfig
config = SpellCheckerConfig(
semantic=SemanticConfig(use_semantic_refinement=False)
)
Symptoms:
RuntimeError: CUDA out of memory
Cause: GPU memory insufficient for transformer model.
Solutions:
-
Use CPU instead:
from myspellchecker.core.config import SpellCheckerConfig, POSTaggerConfig
config = SpellCheckerConfig(
pos_tagger=POSTaggerConfig(device=-1) # -1 for CPU
)
-
Use smaller model or Viterbi tagger:
from myspellchecker.core.config import SpellCheckerConfig, POSTaggerConfig
config = SpellCheckerConfig(
pos_tagger=POSTaggerConfig(tagger_type="viterbi")
)
CLI Issues
Issue: Command not found
Symptoms:
bash: myspellchecker: command not found
Cause: CLI not in PATH.
Solutions:
-
Check installation:
-
Use the CLI entry point directly:
Alternatively, use
python -m myspellchecker which is also supported.
-
Add scripts to PATH:
export PATH="$PATH:$(python -c 'import site; print(site.USER_BASE)')/bin"
Issue: Build command fails
Symptoms:
Error: Input file not found
Cause: Incorrect file path or format.
Solutions:
-
Use absolute path:
myspellchecker build --input /full/path/to/corpus.txt
-
Check file format: Ensure UTF-8 encoding with Myanmar text
-
Verify permissions:
Getting More Help
If your issue isn’t covered here:
-
Enable debug logging:
from myspellchecker.utils.logging_utils import configure_logging
configure_logging(level="DEBUG")
-
Check GitHub Issues: Search existing issues for similar problems
-
Open a new issue with:
- Python version
- mySpellChecker version
- Full error traceback
- Minimal reproduction code
- Expected vs actual behavior
See Also