FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    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.

    Source

    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.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • IntoIterator
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone
    • Debug
    • Iterator

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.