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-2.1.1.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-2.1.1-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ckb_textify-2.1.1.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-2.1.1.tar.gz
Algorithm Hash digest
SHA256 f2da338b3c6162259755e2932bde0c3cc4a48b392f26a91b701cb2b82a92b228
MD5 952ba3ad2cb8593c1ecd804042c1ce0c
BLAKE2b-256 f3246ca9392593ac4cf77e5791d8f1f91b336b8733324ced46c7eff9f518496e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ckb_textify-2.1.1-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-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 451ab3edd48057b7b13d180c3eead140c738a0f02ee2715d8e3edefa90117559
MD5 a5712150ca5a89807b31abb98a9068f8
BLAKE2b-256 5b9c29373c63b7604b5d3a7c59dfb01194251a2d08b935deb65a7e846525a3b5

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