pub struct SentenceSegmenter(/* private fields */);
Expand description
An ICU4X sentence-break segmenter, capable of finding sentence breakpoints in strings.
Implementations§
Source§impl SentenceSegmenter
impl SentenceSegmenter
Sourcepub fn create() -> Box<SentenceSegmenter>
pub fn create() -> Box<SentenceSegmenter>
Construct a SentenceSegmenter
using compiled data. This does not assume any content locale.
Sourcepub fn create_with_content_locale(
locale: &Locale,
) -> Result<Box<SentenceSegmenter>, DataError>
pub fn create_with_content_locale( locale: &Locale, ) -> Result<Box<SentenceSegmenter>, DataError>
Construct a SentenceSegmenter
for content known to be of a given locale, using compiled data.
Sourcepub fn create_with_content_locale_and_provider(
provider: &DataProvider,
locale: &Locale,
) -> Result<Box<SentenceSegmenter>, DataError>
pub fn create_with_content_locale_and_provider( provider: &DataProvider, locale: &Locale, ) -> Result<Box<SentenceSegmenter>, DataError>
Construct a SentenceSegmenter
for content known to be of a given locale, using a particular data source.
Sourcepub fn segment_utf8<'a>(
&'a self,
input: &'a DiplomatStr,
) -> Box<SentenceBreakIteratorUtf8<'a>>
pub fn segment_utf8<'a>( &'a self, input: &'a DiplomatStr, ) -> Box<SentenceBreakIteratorUtf8<'a>>
Segments a string.
Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according to the WHATWG Encoding Standard.
Sourcepub fn segment_utf16<'a>(
&'a self,
input: &'a DiplomatStr16,
) -> Box<SentenceBreakIteratorUtf16<'a>>
pub fn segment_utf16<'a>( &'a self, input: &'a DiplomatStr16, ) -> Box<SentenceBreakIteratorUtf16<'a>>
Segments a string.
Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according to the WHATWG Encoding Standard.
Sourcepub fn segment_latin1<'a>(
&'a self,
input: &'a [u8],
) -> Box<SentenceBreakIteratorLatin1<'a>>
pub fn segment_latin1<'a>( &'a self, input: &'a [u8], ) -> Box<SentenceBreakIteratorLatin1<'a>>
Segments a Latin-1 string.
Auto Trait Implementations§
impl Freeze for SentenceSegmenter
impl RefUnwindSafe for SentenceSegmenter
impl Send for SentenceSegmenter
impl Sync for SentenceSegmenter
impl Unpin for SentenceSegmenter
impl UnwindSafe for SentenceSegmenter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more