Repository navigation
Contributing
github-actions[bot] edited this page Aug 24, 2026
·
1 revision
We welcome contributions. Adding a new language takes about 10 minutes and requires zero changes to the core segmentation engine.
We use uv for fast, deterministic development:
# 1. Clone repository
git clone https://github.com/sb-chaos/cleave-sbd.git
cd cleave-sbd
# 2. Install all development dependencies (pytest, basedpyright, ruff)
uv sync --all-groupsBefore opening a PR, run the local validation script:
bash validate.shThis runs:
-
Ruff Auto-Fixes & Formatting:
uv run ruff check --fix && uv run ruff format -
Strict Lint Verification:
uv run ruff check && uv run ruff format --check -
Strict Type Checking:
uv run basedpyright(PEP 561 / strict mode with 0 errors) -
Pytest Test Suite:
uv run pytest -
Distribution Build:
uv build
Adding a language requires zero changes to core engine logic (segmenter.py, disambiguator.py, or models.py).
Add a configuration file in src/csbd/language/configs/<iso_code>.toml (e.g. src/csbd/language/configs/ko.toml for Korean):
[language]
code = "ko"
name = "Korean"
replace_all_abbr_periods = false
[punctuations]
marks = ["。", "!", "?", ".", "!", "?"]
[abbreviations]
standard = [
"etc",
"co",
"inc",
]
prepositive = [
"dr",
"prof",
"mr",
"ms",
]
number = [
"no",
"vol",
"p",
]Add the language definition to src/csbd/language/lang.py under the SUPPORTED_LANGUAGES mapping.
Create a test file in tests/fixtures/golden_rules/<iso_code>.json with language-specific test sentences, and run:
uv run pytest tests/test_languages.py -k <iso_code>When submitting changes, follow the Architecture Philosophy:
-
Zero Runtime Dependencies: Rely solely on Python 3.11+ standard library modules. Never add packages to
[project.dependencies]. -
Strict Typing (PEP 561): All code must be fully annotated with zero untyped dictionaries or implicit
Any. - Layered Decoupling: Never declare data models inside processing or orchestrator layers.
-
Declarative Rules: Avoid runtime lambdas or dynamic regex compilations inside loops. Use immutable
Rule(pattern, replacement)tuples.