Metadata-Version: 2.4
Name: arabic-cleaner
Version: 0.1.0
Summary: Arabic text cleaning and normalization
Author: 0alfajar
License: MIT
Keywords: arabic,nlp,text-cleaning,normalization
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# Arabic Cleaner

A lightweight Python library for cleaning and normalizing Arabic text, designed for natural language processing (NLP) tasks such as Quranic text preprocessing.

---

## Overview

Arabic text often contains diacritics, inconsistent character forms, and non-standard symbols that can negatively affect downstream NLP models. This library provides a simple and efficient pipeline to normalize and clean Arabic text before further processing.

---

## Features

- **Remove Arabic diacritics (harakat):** Efficiently strips all Arabic harakat.
- **Normalize common character variations:** Standardizes variations of Alif, Hamza, etc.
- **Filter non-Arabic characters:** Removes unwanted symbols to ensure data purity.
- **Simple and modular cleaning pipeline:** Designed to be lightweight and easily integrated.
- **Command-line interface (CLI) support:** Quick processing directly from the terminal.

---

## Installation

Install from PyPI:

```bash
pip install arabic-cleaner
```

For development (editable mode):

```bash
pip install -e .
```

---

## Usage

### Python

```python
from arabic_cleaner import clean_text

text = "إِنَّ ٱللَّهَ غَفُورٌ رَّحِيمٌ"
result = clean_text(text)

print(result)
```

Output:

```text
ان الله غفور رحيم
```

### Command Line Interface

```bash
arabic-clean "إِنَّ ٱللَّهَ غَفُورٌ رَّحِيمٌ"
```

---

## API

`clean_text(text, remove_diacritics=True)`

| Parameter | Type | Description |
|---|---|---|
| `text` | `str` | Input Arabic text |
| `remove_diacritics` | `bool` | Whether to remove diacritics (default is `True`) |

Example:

Input: `إِنَّ ٱللَّهَ غَفُورٌ رَّحِيمٌ`

Output: `ان الله غفور رحيم`

---

## Project Structure

```text
arabic_cleaner/
│── __init__.py
│── cleaner.py
│── normalizer.py
│── cli.py
```

---

## Use Cases

- Arabic NLP preprocessing
- Quranic text normalization
- Speech-to-text postprocessing
- Machine learning data cleaning pipelines

---

## License

MIT License
