use pyo3::prelude::*;
#[pyfunction]
#[pyo3(signature = (text,))]
pub fn _grapheme_len(text: &str) -> usize {
crate::grapheme::grapheme_len(text)
}
#[pyfunction]
#[pyo3(signature = (text,))]
pub fn _grapheme_split(text: &str) -> Vec<String> {
crate::grapheme::grapheme_split(text)
}
#[pyfunction]
#[pyo3(signature = (text, max_graphemes))]
pub fn _grapheme_truncate(text: &str, max_graphemes: i64) -> PyResult<String> {
let max_graphemes = crate::error::checked_max_graphemes(max_graphemes)?;
Ok(crate::grapheme::truncate_to_graphemes(text, max_graphemes))
}