Sign in

    ShiChengxu/moonlayout/segment does not have a README file

    SegmentKind

    pub(all) enum SegmentKind {
    Word
    Sentence
    } derive(Eq,
    Debug
    )

    Select the default Unicode boundary algorithm.

    SegmentKind::equal

    fn SegmentKind::equal(SegmentKind, SegmentKind) -> Bool

    SegmentKind::not_equal

    fn SegmentKind::not_equal(x : SegmentKind, y : SegmentKind) -> Bool

    segments

    fn segments(s : String, kind : SegmentKind) -> Array[(Int, Int)]

    All half-open UTF-8 byte ranges, including whitespace/punctuation segments.

    sentence_boundaries

    fn sentence_boundaries(s : String) -> Array[Int]

    Unicode 17 UAX #29 sentence boundaries as UTF-8 byte offsets. Includes both endpoints. Separators and trailing spaces belong to the preceding sentence.

    sentences

    fn sentences(s : String) -> Array[String]

    Split sentences without dropping punctuation, whitespace or paragraph breaks.

    word_boundaries

    fn word_boundaries(s : String) -> Array[Int]

    Unicode 17 UAX #29 default word boundaries, in UTF-8 bytes. Includes both endpoints; an empty string has the single boundary [0].

    words

    fn words(s : String) -> Array[String]

    Return word segments containing a letter or number. Whitespace, punctuation, and emoji-only segments are omitted; use word_boundaries to retain all text.

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io