// Simple debug test for normalization stage
use cadar::stages::normalization::Normalizer;
use cadar::types::Script;

fn main() {
    println!("=== Testing Normalization Stage ===");

    let normalizer = Normalizer::new();

    // Test cases for long vowels
    let test_cases = vec![
        ("aa", Script::Latin),
        ("ii", Script::Latin),
        ("uu", Script::Latin),
        ("oo", Script::Latin),
        ("laa", Script::Latin),
        ("اا", Script::Arabic),
        ("يي", Script::Arabic),
        ("وو", Script::Arabic),
        ("لاا", Script::Arabic),
    ];

    for (input, script) in test_cases {
        println!("\n--- Testing: '{}' ---", input);

        // Test the fix_repeated_chars function directly
        let after_fix = normalizer.fix_repeated_chars(input);
        println!("After fix_repeated_chars: '{}'", after_fix);

        // Test the full normalization pipeline
        match normalizer.normalize(input, script) {
            Ok(normalized) => {
                println!("Full normalization: '{}' -> '{}'", input, normalized);
            }
            Err(e) => {
                println!("Error normalizing '{}': {:?}", input, e);
            }
        }
    }

    println!("\n=== Test completed ===");
}
