#![deny(missing_docs, unsafe_code)]
#![doc(
html_logo_url = "https://unicode-rs.github.io/unicode-rs_sm.png",
html_favicon_url = "https://unicode-rs.github.io/unicode-rs_sm.png"
)]
#![no_std]
pub use grapheme::{GraphemeCursor, GraphemeIncomplete};
pub use grapheme::{GraphemeIndices, Graphemes};
pub use sentence::{USentenceBoundIndices, USentenceBounds, UnicodeSentences};
pub use tables::UNICODE_VERSION;
pub use word::{UWordBoundIndices, UWordBounds, UnicodeWordIndices, UnicodeWords};
mod grapheme;
mod sentence;
#[rustfmt::skip]
mod tables;
mod word;
pub trait UnicodeSegmentation {
fn graphemes(&self, is_extended: bool) -> Graphemes<'_>;
fn grapheme_indices(&self, is_extended: bool) -> GraphemeIndices<'_>;
fn unicode_words(&self) -> UnicodeWords<'_>;
fn unicode_word_indices(&self) -> UnicodeWordIndices<'_>;
fn split_word_bounds(&self) -> UWordBounds<'_>;
fn split_word_bound_indices(&self) -> UWordBoundIndices<'_>;
fn unicode_sentences(&self) -> UnicodeSentences<'_>;
fn split_sentence_bounds(&self) -> USentenceBounds<'_>;
fn split_sentence_bound_indices(&self) -> USentenceBoundIndices<'_>;
}
impl UnicodeSegmentation for str {
#[inline]
fn graphemes(&self, is_extended: bool) -> Graphemes {
grapheme::new_graphemes(self, is_extended)
}
#[inline]
fn grapheme_indices(&self, is_extended: bool) -> GraphemeIndices {
grapheme::new_grapheme_indices(self, is_extended)
}
#[inline]
fn unicode_words(&self) -> UnicodeWords {
word::new_unicode_words(self)
}
#[inline]
fn unicode_word_indices(&self) -> UnicodeWordIndices {
word::new_unicode_word_indices(self)
}
#[inline]
fn split_word_bounds(&self) -> UWordBounds {
word::new_word_bounds(self)
}
#[inline]
fn split_word_bound_indices(&self) -> UWordBoundIndices {
word::new_word_bound_indices(self)
}
#[inline]
fn unicode_sentences(&self) -> UnicodeSentences {
sentence::new_unicode_sentences(self)
}
#[inline]
fn split_sentence_bounds(&self) -> USentenceBounds {
sentence::new_sentence_bounds(self)
}
#[inline]
fn split_sentence_bound_indices(&self) -> USentenceBoundIndices {
sentence::new_sentence_bound_indices(self)
}
}