Skip to main content
Follow the steps below to clone the repository, install dependencies, build Cython extensions, and verify everything works before making your first contribution.

Prerequisites

  • Python 3.10+ (3.11 recommended)
  • Git
  • C++ compiler (for Cython extensions)
    • Linux: gcc or clang
    • macOS: Xcode Command Line Tools
    • Windows: Visual Studio Build Tools

Optional

  • OpenMP (for parallel processing)
    • macOS: brew install libomp
    • Linux: Usually pre-installed
  • CUDA (for GPU acceleration with transformer models)

Quick Setup

Detailed Setup

1

Clone Repository

2

Create Virtual Environment

3

Install Dependencies

Available extras groups:
4

Build Cython Extensions

This compiles all 11 Cython modules:
  • text/normalize_c.pyx - Text normalization
  • algorithms/viterbi.pyx - POS tagging
  • algorithms/distance/edit_distance_c.pyx - Levenshtein distance
  • data_pipeline/batch_processor.pyx - Parallel batch processing
  • data_pipeline/frequency_counter.pyx - Fast frequency calculations
  • data_pipeline/ingester_c.pyx - Corpus ingestion
  • data_pipeline/repair_c.pyx - Segmentation repair
  • data_pipeline/tsv_reader_c.pyx - TSV file reading
  • tokenizers/cython/word_segment.pyx - Word segmentation
  • tokenizers/cython/mmap_reader.pyx - Memory-mapped file reading
  • core/syllable_rules_c.pyx - Syllable rule validation
5

Build Sample Database

This creates a test database for development.

IDE Setup

VS Code

Recommended extensions:
  • Python (Microsoft)
  • Pylance
  • Cython
.vscode/settings.json:

PyCharm

  1. Open project folder
  2. Configure interpreter: venv/bin/python
  3. Mark src as Sources Root
  4. Enable Ruff plugin for linting

Environment Variables

Verifying Setup

Run Tests

Check Cython

Test Spell Checker

Common Issues

Cython Build Fails

Error: fatal error: Python.h: No such file or directory Solution: Install Python development headers

OpenMP Not Found (macOS)

Error: ld: library not found for -lomp Solution:

Database Not Found

Error: MissingDatabaseError Solution:

Import Errors

Error: ModuleNotFoundError: No module named 'myspellchecker' Solution:

Development Workflow

1

Create Branch

2

Make Changes

Edit code in src/myspellchecker/
3

Run Quality Checks

4

Rebuild Cython (if modified .pyx)

5

Commit and Push

See Also