Struct icu_capi::segmenter_sentence::ffi::SentenceSegmenter
source · 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(
provider: &DataProvider,
) -> Result<Box<SentenceSegmenter>, DataError>
pub fn create( provider: &DataProvider, ) -> Result<Box<SentenceSegmenter>, DataError>
Construct an SentenceSegmenter
.
sourcepub fn create_with_content_locale(
provider: &DataProvider,
locale: &Locale,
) -> Result<Box<SentenceSegmenter>, DataError>
pub fn create_with_content_locale( provider: &DataProvider, locale: &Locale, ) -> Result<Box<SentenceSegmenter>, DataError>
Construct an SentenceSegmenter
.
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