Import with #import "std/grapheme".

IsControl :: (property: s32) -> bool
State :: struct { active: bool; valid: bool; previous: s32; regional: s32; pictographic: bool; joined_pictographic: bool; consonant: bool; linker: bool; }

Streaming segmentation also supports callers reading segmented or borrowed text without joining it into an allocation.

Step :: struct { state: State; boundary: bool; }
Push :: (state: State, scalar: u32, valid: bool) -> Step
Boundary :: (value: string, at: s32) -> s32

Snap a borrowed byte offset down to a complete grapheme boundary.

Count :: (value: string) -> s32

Source ↗ · All modules