use std::sync::OnceLock;
use icu_properties::{props, CodePointSetData, CodePointSetDataBorrowed};
static DEFAULT_IGNORABLES: OnceLock<CodePointSetDataBorrowed<'static>> = OnceLock::new();
static EMOJI_SET: OnceLock<CodePointSetDataBorrowed<'static>> = OnceLock::new();
pub fn is_hidden_char(c: char) -> bool {
DEFAULT_IGNORABLES
.get_or_init(CodePointSetData::new::<props::DefaultIgnorableCodePoint>)
.contains(c)
}
pub fn is_keyboard_ascii(c: char) -> bool {
matches!(c, '\n' | '\r' | '\t') || (c.is_ascii() && !c.is_ascii_control())
}
pub fn is_extended_keyboard_char(c: char) -> bool {
matches!(
c,
'€' | '£' | '¥' | '¢' | '§' | '°' | '±' | '×' | '÷' | '–' | '—' | '…' | '•' | '·'
)
}
pub fn is_emoji(c: char) -> bool {
EMOJI_SET
.get_or_init(CodePointSetData::new::<props::Emoji>)
.contains(c)
}