#![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]
#[cfg(test)]
#[macro_use]
extern crate std;
#[cfg(test)]
#[macro_use]
extern crate quickcheck;
pub use grapheme::{Graphemes, GraphemeIndices};
pub use grapheme::{GraphemeCursor, GraphemeIncomplete};
pub use tables::UNICODE_VERSION;
pub use word::{UWordBounds, UWordBoundIndices, UnicodeWords};
pub use sentence::{USentenceBounds, USentenceBoundIndices, UnicodeSentences};
mod grapheme;
mod tables;
mod word;
mod sentence;
#[cfg(test)]
mod test;
#[cfg(test)]
mod testdata;
pub trait UnicodeSegmentation {
fn graphemes<'a>(&'a self, is_extended: bool) -> Graphemes<'a>;
fn grapheme_indices<'a>(&'a self, is_extended: bool) -> GraphemeIndices<'a>;
fn unicode_words<'a>(&'a self) -> UnicodeWords<'a>;
fn split_word_bounds<'a>(&'a self) -> UWordBounds<'a>;
fn split_word_bound_indices<'a>(&'a self) -> UWordBoundIndices<'a>;
fn unicode_sentences<'a>(&'a self) -> UnicodeSentences<'a>;
fn split_sentence_bounds<'a>(&'a self) -> USentenceBounds<'a>;
fn split_sentence_bound_indices<'a>(&'a self) -> USentenceBoundIndices<'a>;
}
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 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)
}
}