"""
sindhinltk.normalizer — Sindhi text normalization.

NFKC normalization with Sindhi-specific Unicode handling:
- Farsi ya → Arabic ya unification
- Zero-width joiner/non-joiner removal
- Whitespace normalization

NOTE: This is a STUB for the v1.1 package structure.
      Copy your existing normalizer code from v1.0.4 into this file.
      The public API must expose: normalize(text) -> str
"""

# ┌───────────────────────────────────────────────────────────┐
# │  PASTE YOUR EXISTING normalizer.py CODE FROM v1.0.4 HERE │
# │  Keep the same normalize() function signature.           │
# └───────────────────────────────────────────────────────────┘

import unicodedata
import re


def normalize(text: str) -> str:
    """
    Normalize Sindhi text.

    Applies:
    - Unicode NFC normalization
    - Farsi ya (U+06CC) → Arabic ya (U+064A)
    - Zero-width character removal
    - Whitespace normalization

    Args:
        text: Raw Sindhi text.

    Returns:
        Normalized text string.

    Example:
        >>> from sindhinltk.normalizer import normalize
        >>> normalize('  سنڌ   جو  ')
        'سنڌ جو'
    """
    text = unicodedata.normalize('NFC', text)
    text = text.replace('\u06CC', '\u064A')  # Farsi ya → Arabic ya
    for zw in ['\u200C', '\u200D', '\u200B', '\uFEFF', '\u00AD']:
        text = text.replace(zw, '')
    text = re.sub(r'[ \t]+', ' ', text).strip()
    return text
