pub struct SentenceSegmenterBorrowed<'data> {
data: &'data RuleBreakData<'data>,
locale_override: Option<&'data RuleBreakDataOverride<'data>>,
}Expand description
Segments a string into sentences (borrowed version).
See SentenceSegmenter for examples.
Fields§
§data: &'data RuleBreakData<'data>§locale_override: Option<&'data RuleBreakDataOverride<'data>>Implementations§
Source§impl<'data> SentenceSegmenterBorrowed<'data>
impl<'data> SentenceSegmenterBorrowed<'data>
Sourcepub fn segment_str<'s>(
self,
input: &'s str,
) -> SentenceBreakIterator<'data, 's, Utf8> ⓘ
pub fn segment_str<'s>( self, input: &'s str, ) -> SentenceBreakIterator<'data, 's, Utf8> ⓘ
Creates a sentence break iterator for an str (a UTF-8 string).
There are always breakpoints at 0 and the string length, or only at 0 for the empty string.
Sourcepub fn segment_utf8<'s>(
self,
input: &'s [u8],
) -> SentenceBreakIterator<'data, 's, PotentiallyIllFormedUtf8> ⓘ
pub fn segment_utf8<'s>( self, input: &'s [u8], ) -> SentenceBreakIterator<'data, 's, PotentiallyIllFormedUtf8> ⓘ
Creates a sentence break iterator for a potentially ill-formed UTF8 string
Invalid characters are treated as REPLACEMENT CHARACTER
There are always breakpoints at 0 and the string length, or only at 0 for the empty string.
Sourcepub fn segment_latin1<'s>(
self,
input: &'s [u8],
) -> SentenceBreakIterator<'data, 's, Latin1> ⓘ
pub fn segment_latin1<'s>( self, input: &'s [u8], ) -> SentenceBreakIterator<'data, 's, Latin1> ⓘ
Creates a sentence break iterator for a Latin-1 (8-bit) string.
There are always breakpoints at 0 and the string length, or only at 0 for the empty string.
Sourcepub fn segment_utf16<'s>(
self,
input: &'s [u16],
) -> SentenceBreakIterator<'data, 's, Utf16> ⓘ
pub fn segment_utf16<'s>( self, input: &'s [u16], ) -> SentenceBreakIterator<'data, 's, Utf16> ⓘ
Creates a sentence break iterator for a UTF-16 string.
There are always breakpoints at 0 and the string length, or only at 0 for the empty string.
Source§impl SentenceSegmenterBorrowed<'static>
impl SentenceSegmenterBorrowed<'static>
Sourcepub const fn static_to_owned(self) -> SentenceSegmenter
pub const fn static_to_owned(self) -> SentenceSegmenter
Cheaply converts a SentenceSegmenterBorrowed<'static> into a SentenceSegmenter.
Note: Due to branching and indirection, using SentenceSegmenter might inhibit some
compile-time optimizations that are possible with SentenceSegmenterBorrowed.
Trait Implementations§
Source§impl<'data> Clone for SentenceSegmenterBorrowed<'data>
impl<'data> Clone for SentenceSegmenterBorrowed<'data>
Source§fn clone(&self) -> SentenceSegmenterBorrowed<'data>
fn clone(&self) -> SentenceSegmenterBorrowed<'data>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more