Durak
Durak is a Turkish natural language processing toolkit focused on reliable preprocessing building blocks. It offers configurable cleaning, tokenisation, stopword management, lemmatisation adapters, and frequency statistics so projects can bootstrap robust text pipelines quickly.
- Homepage: karagoz.io
- Repository: github.com/fbkaragoz/durak
- Issue tracker: github.com/fbkaragoz/durak/issues
Quickstart
1. Install
pip install durak-nlp
2. Minimal pipeline
from durak import process_text
entries = [
"Türkiye'de NLP zor. Durak kolaylaştırır.",
"Ankara ' da kaldım.",
]
tokens = [
process_text(
entry,
remove_stopwords=True,
rejoin_suffixes=True, # glue detached suffixes before filtering
)
for entry in entries
]
print(tokens[0])
# ["türkiye'de", "nlp", "zor", ".", "durak", "kolaylaştırır", "."]
print(tokens[1])
# ["ankara'da", "kaldım", "."]
The pipeline executes the steps in order: clean → tokenize → rejoin detached suffixes (when enabled) → remove stopwords (when enabled). This keeps noisy social-media strings consistent before filtering.
Need a quick lookup? is_stopword("ve") returns True, while list_stopwords()[:5] reveals the first few entries of the curated base set.
3. Build blocks à la carte
from durak import (
StopwordManager,
attach_detached_suffixes,
clean_text,
remove_stopwords,
tokenize,
)
text = "İstanbul ' a vapurla geçtik."
cleaned = clean_text(text)
tokens = tokenize(cleaned)
tokens = attach_detached_suffixes(tokens)
# Keep custom terms while extending the curated stopwords
manager = StopwordManager(additions=["vapurla"], keep=["istanbul'a"])
filtered = remove_stopwords(tokens, manager=manager)
print(filtered)
# ["istanbul'a", "geçtik", "."]
Features
- Unicode-aware cleaning utilities tuned for Turkish content (social, news, informal text).
- Configurable stopword management with keep-lists, custom additions,
is_stopword, andlist_stopwordshelpers. - Regex-based tokenizer and sentence splitter with clitic and diacritic preservation.
- Lightweight corpus validator to guard Turkish-specific artefacts.
- Ready for extension with future lemmatization and subword adapters.
Development Setup
python -m venv .venv
source .venv/bin/activate
pip install -e .[dev]
pytest
Before submitting changes, run:
ruff check .
mypy src
pytest
Refer to CONTRIBUTING.md for the full workflow, coding standards, and release process. The project roadmap lives in ROADMAP.md, and notable changes are tracked in CHANGELOG.md.
Community & Support
- Code of Conduct: CODE_OF_CONDUCT.md
- Security policy: SECURITY.md
- Citation guidance: CITATION.cff
- Topics:
turkish-nlp,nlp,tokenization,lemmatization,text-processing,pre-processing,python
License
Durak is distributed under the Durak License v1.2. Commercial or institutional use requires explicit written permission from the author.
Metadata
Release files for durak-nlp 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| durak_nlp-0.2.4.tar.gz | 20.7 kB | Without provenance | Details for durak_nlp-0.2.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| durak_nlp-0.2.4-py3-none-any.whl | Python 3 | none | any | Details for durak_nlp-0.2.4-py3-none-any.whl |
Total release size: 37.9 kB
Release files / durak_nlp-0.2.4.tar.gz
| Download URL | durak_nlp-0.2.4.tar.gz |
|---|---|
| Size | 20.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d9f4f2caba95e571fe64dce308ce9c048624e16363dce3fbc36b2c07cd95f65d
|
|
BLAKE2b-256 checksum How to use checksums |
fe17d1849971361fa516d8bcb1fb6a9bd031379f8be00be5880460c6eada42e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / durak_nlp-0.2.4-py3-none-any.whl
| Download URL | durak_nlp-0.2.4-py3-none-any.whl |
|---|---|
| Size | 17.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ba5ad3a626c6041a8ee34e0c744e7b30127dbd68cc585184654363132b78a6c2
|
|
BLAKE2b-256 checksum How to use checksums |
9d39ce1377d23f47dfa8fc6414646da44c55ea7e66628c1260d12615954ce13d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for durak-nlp 0.2.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.