#!/usr/bin/env python3

import sys
import os

sys.path.insert(0, "/home/ouaillaamiri/Development/Oit LAB/CaDaR")

from cadar import CaDaR


def debug_laa():
    """Debug the specific 'laa' case in detail"""
    print("=== Detailed Debug: 'laa' ===")

    cadar = CaDaR()

    # Test individual characters first
    print("Testing individual characters:")
    l_arabic = cadar.bizi2ara("l")
    print(f"l → {l_arabic}")

    a_arabic = cadar.bizi2ara("a")
    print(f"a → {a_arabic}")

    aa_arabic = cadar.bizi2ara("aa")
    print(f"aa → {aa_arabic}")

    # Test roundtrip
    print("\nTesting roundtrip:")
    print(f"aa → {aa_arabic}")
    aa_roundtrip = cadar.ara2bizi(aa_arabic)
    print(f"{aa_arabic} → {aa_roundtrip}")

    # Test the full word
    print("\nTesting full word:")
    laa_arabic = cadar.bizi2ara("laa")
    print(f"laa → {laa_arabic}")
    laa_roundtrip = cadar.ara2bizi(laa_arabic)
    print(f"{laa_arabic} → {laa_roundtrip}")

    print("=" * 40)


if __name__ == "__main__":
    debug_laa()
