icu_properties::maps

Function grapheme_cluster_break

Source
pub const fn grapheme_cluster_break() -> CodePointMapDataBorrowed<'static, GraphemeClusterBreak>
Expand description

Return a CodePointMapDataBorrowed for the Grapheme_Cluster_Break Unicode enumerated property. See GraphemeClusterBreak.

Enabled with the compiled_data Cargo feature.

📚 Help choosing a constructor

Note: Use icu::segmenter for an all-in-one break iterator implementation.

§Example

use icu::properties::{maps, GraphemeClusterBreak};

assert_eq!(maps::grapheme_cluster_break().get('🇦'), GraphemeClusterBreak::RegionalIndicator); // U+1F1E6: Regional Indicator Symbol Letter A
assert_eq!(maps::grapheme_cluster_break().get('ำ'), GraphemeClusterBreak::SpacingMark); //U+0E33: Thai Character Sara Am