Skip to main content

A comprehensive Text Normalization library for Central Kurdish (Sorani).

Project description

ckb-textify

ckb-textify is a comprehensive, industrial-strength Text Normalization and Transliteration library designed specifically for Central Kurdish (Sorani).

It is built to prepare "messy" real-world text for Natural Language Processing (NLP) tasks, with a specific focus on Text-to-Speech (TTS) engines. It handles complex ambiguity, mixed-script (English/Kurdish) text, technical codes, and locale-specific formats like Iraqi phone numbers.

📦 Installation

You can install the package directly from PyPI:

pip install ckb-textify

Dependencies:

  • eng-to-ipa: Used for accurate English-to-Sorani transliteration.

🚀 Quick Start

Python Example

from ckb_textify import convert_all

text = "سڵاو، پەیوەندی بکە بە 07501234567.
نرخی کاڵاکە $12.50 یە.
کۆدەکە A1-B2 یە."

normalized = convert_all(text)

print(normalized)

Output:

سڵاو, پەیوەندی بکە بە سفر حەوت سەد و پەنجا سەد و بیست و سێ چل و پێنج شەست و حەوت.
نرخی کاڵاکە دوازدە دۆلار و پەنجا سەنت یە.
کۆدەکە ئەی یەک داش بی دوو یە.

🎛️ Configuration

You can enable or disable specific normalization modules using a config dictionary.
By default, all features are enabled.

from ckb_textify import convert_all

my_config = {
    "phone_numbers": False,
    "technical": False
}

text = "Call 07501234567 regarding ID: 550e8400."
normalized = convert_all(text, config=my_config)
print(normalized)

Output will keep the phone number and ID unchanged.


🌟 Features & Examples

1. Smart Phone Numbers

Handles Iraqi/Kurdish formats with intelligent grouping (4-3-2-2).

07501234567 → سفر حەوت سەد و پەنجا سەد و بیست و سێ چل و پێنج شەست و حەوت
+964... → کۆ نۆ سەد و شەست و چوار...

2. Math & Scientific Notation

Context-aware processing:

  • 7/6 → حەوت دابەش شەش\
  • km/h → کیلۆمەتر بۆ هەر کاتژمێرێک\
  • 34000000000000000000 → سێ پۆینت چوار جارانی دە توانی نۆزدە\
  • 00025 → سێ جار سفر بیست و پێنج

3. English Transliteration (IPA-Based)

Phone → فۆن
Action → ئاکشن
Google → گووگڵ
GPT → جی پی تی
USA → یو ئێس ئەی

4. Web & Technical Entities

Reads symbols character-by-character:

  • Emails: info@gmail.com → ئای ئێن ئێف ئۆ ئەت جیمەیڵ دۆت کۆم\
  • URLs: www.razwan.net → دابڵیو دابڵیو دابڵیو دۆت ئاڕ ئەی زێت دابڵیو ئەی ئێن دۆت نێت\
  • Codes: A1-B2 → ئەی یەک داش بی دوو\
  • MAC/UUID: Handles patterns like 00:1A:2B...

5. Units & Measurements

10m → دە مەتر
m (alone) → m
10kg → ده کیلۆگرام

6. Currency & Finance

$12.5 → دوازدە دۆلار و نیو
IQD 5000 → پێنج هەزار دیناری عێڕاقی
£50, ¥1000, €20 → Supported

7. Standardization

  • Fixes Unicode inconsistencies (ی, ە, ه, ھ, ة)
  • Expands abbreviations (د. ← دکتۆر)
  • Normalizes Arabic names (محمد ← موحەمەد)

📄 License

This project is licensed under the MIT License.
See the LICENSE file for details.

🤝 Contributing

Contributions are welcome!
Open an issue or submit a pull request with improvements or new rules.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ckb_textify-0.2.0.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ckb_textify-0.2.0-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file ckb_textify-0.2.0.tar.gz.

File metadata

  • Download URL: ckb_textify-0.2.0.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for ckb_textify-0.2.0.tar.gz
Algorithm Hash digest
SHA256 acaedb4b015b38540087cc56ea1fc5590f80d3a91a1fd052c9e13d34646173ec
MD5 ed2aeedcde62fe0290bd0ee736ac0d18
BLAKE2b-256 4139158dee023d2ca1d421a632e2ca585ed2d3c337cdf0a70c59f7583ad749d0

See more details on using hashes here.

File details

Details for the file ckb_textify-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ckb_textify-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 30.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for ckb_textify-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dac927662adbaffe4c4e7084effe15f67feb7a133d254840b94326cfca41db6f
MD5 0f2b7926515d64b065c70319c882c2b5
BLAKE2b-256 e796fc08ff1410932581e964fa5d0aaf08a8d02de80622b2a194e2c5262f2a8d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page