Skip to main content

turkish-linguistic-features

CI DOI

Extracts 214 quantitative linguistic features from Turkish text and 181 from English. Every feature has its formula written out; 203 of the Turkish features and 170 of the English ones cite a source in the literature, and the rest are plain definitions (such as the dash's share of punctuation marks). The verification report shows which ones have been checked against a number their source published. Documentation: https://efeziya1.github.io/turkish-linguistic-features/

Status: early development (0.x). Changes: CHANGELOG.

import turkish_linguistic_features as tlf

oz = tlf.analyze("Renksiz yeşil fikirler öfkeyle uyur.", lang="tr")
oz["word_len_mean"]   # 6.2
oz["atesman"]         # 89.355  (Ateşman 1997 readability)

Documentation

→ Full documentation — tutorial, how-to guides, feature reference and limitations, in Turkish and English.

Türkçe tr/
English en/
Feature reference reference/features/
Verification report TR · EN

Install

pip install turkish-linguistic-features

Language data

pip install sets up the Python dependencies but not the language data. Install the data for the language(s) you use, once:

# Turkish — 156 MB. The model is by turkish-nlp-suite and is not in spaCy's
# registry, so install the wheel directly:
pip install https://huggingface.co/turkish-nlp-suite/tr_core_news_md/resolve/main/tr_core_news_md-1.0-py3-none-any.whl

# English — the spaCy model (12 MB) and the CMU Pronouncing Dictionary for
# syllable counts (1 MB):
python -m spacy download en_core_web_sm
python -m nltk.downloader cmudict

# Optional — for the two wordfreq_* features:
pip install 'wordfreq>=3.0'

If something is missing, analyze() stops with an error that shows the command to run.

Verified with spaCy 3.8.16, en_core_web_sm 3.8.0 and tr_core_news_md 1.0. The Turkish wheel says 1.0 in its filename but 3.4.2 in its metadata, and loading it prints a W094 warning; both are harmless (details).

The whole API

Eleven public names:

tlf.analyze(text, lang="tr")                     # 214 features (TR) / 181 (EN)
tlf.analyze(text, groups=["readability"])        # one group only
tlf.analyze_corpus("corpus/")                    # one row per file
tlf.analyze_corpus("corpus/", segment_size=1000) # or split into chunks
tlf.save_csv(rows, "features.csv")               # write them out
tlf.segment_text(text, segment_size=1000, lang="tr")  # split a single text
tlf.analyze(text, custom_ngrams=[["ADJ", "NOUN"], ["EV", "VERB"]])  # count your own phrases (UPPERCASE = lemma)
tlf.ngram_matches(text, ["ADJ", "NOUN"])         # ...and see what they matched
tlf.describe_feature("mtld")                     # what a key measures, and its source
tlf.FeatureParams(mattr_window=100)              # metric constants

# tlf.LinguisticFeaturesError  tlf.ModelNotFoundError
# tlf.MissingDependencyWarning  tlf.ParagraphStructureWarning

Full signatures: Public API.

Development

pip install -r requirements.txt
pytest                          # pytest -m "" also runs the slow test
ruff check .
python scripts/generate_verification_report.py  # regenerate the verification reports
python scripts/generate_feature_reference.py    # regenerate the feature reference

License

MIT — see LICENSE. The word list turkish_linguistic_features/data/kalyoncu_2025_ek1.txt is not covered by the MIT licence; its source is Kalyoncu (2025).

Metadata

Release files for turkish-linguistic-features 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for turkish-linguistic-features 0.3.0
File Size Uploaded Provenance Actions
turkish_linguistic_features-0.3.0.tar.gz 395.9 kB With provenance Details for turkish_linguistic_features-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for turkish-linguistic-features 0.3.0
File Interpreter ABI Platform Actions
turkish_linguistic_features-0.3.0-py3-none-any.whl Python 3 none any Details for turkish_linguistic_features-0.3.0-py3-none-any.whl

Total release size: 549.0 kB

Release files / turkish_linguistic_features-0.3.0.tar.gz

Download URL turkish_linguistic_features-0.3.0.tar.gz
Size 395.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6e9266c45abc9704d4b4f58f9a1136650487f8ce0bdb0146b6ab8f816a77f5fe
BLAKE2b-256 checksum
How to use checksums
2876c5bc1ea9a8eb9322b192688a780e2cd44d733d5f223a56923ab4253ed076
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / turkish_linguistic_features-0.3.0-py3-none-any.whl

Download URL turkish_linguistic_features-0.3.0-py3-none-any.whl
Size 153.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82287226c073e1fe143bdd6c73ad434660f55fbd984ba94d71cbe479ce0e1da8
BLAKE2b-256 checksum
How to use checksums
e445de93e3f940ed171a4f8731bb6fad273351976cd7273426c4da04a67940c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for turkish-linguistic-features 0.3.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for turkish_linguistic_features-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page