SentenceBreakEnumerator
struct · ferroui-base · v0.5.0
struct SentenceBreakEnumerator<'a>
Enumerates Unicode sentence-boundary segments per UAX #29 rules SB1–SB11, SB998.
The enumerator borrows the text, so every operation is allocation-free. It reads
codepoints with Codepoint::read_at and classifies them via the SentenceBreakClass
property backed by the segmentation trie. Each codepoint is visited a constant
number of times: the left-hand context every rule needs is folded into a few fields as the
walk advances, and the one rule that looks ahead reuses the scan it already made.
Members
new
const fn new(text: &'a [u16]) -> Self
Initializes a new instance of the SentenceBreakEnumerator struct.
text- The text to enumerate sentence segments over.
move_next
fn move_next(self: &mut Self) -> Option<SentenceSegment<'a>>
Moves to the next SentenceSegment.
Returns the current sentence-boundary segment, or None at the end of the text.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyIntoIteratorToOwnedErasedDestructorIntoEitherCloneDebugIterator
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.