//! Unicode TR39 confusable character mappings (non-Latin → Latin).
//!
//! Auto-generated from confusables.txt by scripts/gen_confusables.py.
//! Version: 17.0.0
//!
//! Contains ~1904 mappings from non-Latin scripts to Latin
//! equivalents. Uses compile-time perfect hash maps (`phf`) for O(1)
//! lookups. Covers Cyrillic, Greek, Armenian, Georgian, CJK compatibility,
//! mathematical symbols, fullwidth forms, and other confusable characters.
//!
//! PHF map generated by build.rs from src/tables/data/confusables.tsv.
//! To update the data, regenerate with: python scripts/gen_confusables.py

// Non-Latin → Latin confusable mappings (O(1) PHF lookup).
//
// Maps visually similar non-Latin characters to their Latin prototypes
// per Unicode Technical Report #39.
include!(concat!(env!("OUT_DIR"), "/confusables_phf.rs"));

/// Look up a confusable mapping for a character to the target script.
///
/// Returns the Latin prototype string if the character is a known
/// confusable, or None if it is not.
#[inline]
pub fn lookup(ch: char, target_script: &str) -> Option<&'static str> {
    if target_script != "latin" {
        return None;
    }

    TO_LATIN.get(&ch).copied()
}
