pub struct WordSegmenterBorrowed<'data> {
data: &'data RuleBreakData<'data>,
complex: ComplexPayloadsBorrowed<'data>,
locale_override: Option<&'data RuleBreakDataOverride<'data>>,
}Expand description
Segments a string into words (borrowed version).
See WordSegmenter for examples.
Fields§
§data: &'data RuleBreakData<'data>§complex: ComplexPayloadsBorrowed<'data>§locale_override: Option<&'data RuleBreakDataOverride<'data>>Implementations§
Source§impl<'data> WordSegmenterBorrowed<'data>
impl<'data> WordSegmenterBorrowed<'data>
Sourcepub fn segment_str<'s>(
self,
input: &'s str,
) -> WordBreakIterator<'data, 's, Utf8> ⓘ
pub fn segment_str<'s>( self, input: &'s str, ) -> WordBreakIterator<'data, 's, Utf8> ⓘ
Creates a word 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],
) -> WordBreakIterator<'data, 's, PotentiallyIllFormedUtf8> ⓘ
pub fn segment_utf8<'s>( self, input: &'s [u8], ) -> WordBreakIterator<'data, 's, PotentiallyIllFormedUtf8> ⓘ
Creates a word 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],
) -> WordBreakIterator<'data, 's, Latin1> ⓘ
pub fn segment_latin1<'s>( self, input: &'s [u8], ) -> WordBreakIterator<'data, 's, Latin1> ⓘ
Creates a word 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],
) -> WordBreakIterator<'data, 's, Utf16> ⓘ
pub fn segment_utf16<'s>( self, input: &'s [u16], ) -> WordBreakIterator<'data, 's, Utf16> ⓘ
Creates a word 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 WordSegmenterBorrowed<'static>
impl WordSegmenterBorrowed<'static>
Sourcepub fn static_to_owned(self) -> WordSegmenter
pub fn static_to_owned(self) -> WordSegmenter
Cheaply converts a WordSegmenterBorrowed<'static> into a WordSegmenter.
Note: Due to branching and indirection, using WordSegmenter might inhibit some
compile-time optimizations that are possible with WordSegmenterBorrowed.
Trait Implementations§
Source§impl<'data> Clone for WordSegmenterBorrowed<'data>
impl<'data> Clone for WordSegmenterBorrowed<'data>
Source§fn clone(&self) -> WordSegmenterBorrowed<'data>
fn clone(&self) -> WordSegmenterBorrowed<'data>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more