# Contributing to marathi-shabda

Thank you for your interest in contributing to marathi-shabda! This document provides guidelines for contributing to the project.

## How to Contribute

### Reporting Issues

- Use the GitHub issue tracker
- Provide clear description of the problem
- Include example Marathi words that demonstrate the issue
- Specify expected vs. actual behavior

### Adding Vibhakti Rules

To add new vibhakti detection rules:

1. Edit `src/marathi_shabda/morphology/vibhakti_rules.py`
2. Add your rule to `VIBHAKTI_SUFFIXES` list
3. Ensure rules are ordered by length (longest first)
4. Set appropriate priority (1 = highest)
5. Add test cases in `tests/test_morphology.py`

Example:
```python
VibhaktiRule("नंतर", VibhaktiType.PANCHAMI, 1),
```

### Adding Stem Alternations

To add stem alternation patterns:

1. Edit `src/marathi_shabda/morphology/stem_alternations.py`
2. Add pattern to `STEM_ALTERNATIONS` list
3. Test with real examples

### Improving Transliteration

To improve Roman → Devanagari mapping:

1. Edit `src/marathi_shabda/normalization/transliterator.py`
2. Add mappings to `TRANSLITERATION_MAP`
3. Order by length (longest first)
4. Test with common words

## Code Style

- Follow PEP 8
- Use type hints
- Write docstrings for all public functions
- Keep functions focused and testable
- Run `ruff check` before committing
- Run `mypy` for type checking

## Testing

```bash
# Run all tests
pytest tests/ -v

# Run with coverage
pytest tests/ --cov=marathi_shabda

# Run specific test file
pytest tests/test_morphology.py -v
```

## Development Setup

```bash
# Clone repository
git clone https://github.com/yourusername/marathi-shabda.git
cd marathi-shabda

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest
```

## Philosophy

Remember the core principle:

> **When unsure, defer. When confident, explain why.**

- Don't hallucinate meanings
- Surface ambiguity, don't hide it
- Conservative inference over aggressive guessing
- Dictionary-backed truth over heuristics

## Questions?

Open an issue on GitHub or start a discussion.

Thank you for helping improve Marathi language tooling! 🙏
