#![deny(missing_docs, unsafe_code)]
pub use tables::UNICODE_VERSION;
mod decompose;
mod normalize;
mod recompose;
mod tables;
#[cfg(test)]
mod test;
pub mod char {
pub use normalize::{decompose_canonical, decompose_compatible, compose};
pub use tables::normalization::canonical_combining_class;
}
pub mod str {
pub use super::decompose::Decompositions;
pub use super::recompose::Recompositions;
pub trait UnicodeNormalization {
#[inline]
fn nfd_chars(&self) -> Decompositions;
#[inline]
fn nfkd_chars(&self) -> Decompositions;
#[inline]
fn nfc_chars(&self) -> Recompositions;
#[inline]
fn nfkc_chars(&self) -> Recompositions;
}
impl UnicodeNormalization for str {
#[inline]
fn nfd_chars(&self) -> Decompositions {
super::decompose::new_canonical(self)
}
#[inline]
fn nfkd_chars(&self) -> Decompositions {
super::decompose::new_compatible(self)
}
#[inline]
fn nfc_chars(&self) -> Recompositions {
super::recompose::new_canonical(self)
}
#[inline]
fn nfkc_chars(&self) -> Recompositions {
super::recompose::new_compatible(self)
}
}
}