pub fn load_grapheme_cluster_break(
    provider: &impl DataProvider<GraphemeClusterBreakV1Marker>
) -> Result<CodePointMapData<GraphemeClusterBreak>, PropertiesError>
Expand description

Return a CodePointMapData for the Grapheme_Cluster_Break Unicode enumerated property. See [GraphemeClusterBreak].

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

Example

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

let data = maps::load_grapheme_cluster_break(&icu_testdata::unstable()).expect("The data should be valid!");
let gcb = data.as_borrowed();

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