icu_properties::exemplar_chars

Function exemplars_main

Source
pub fn exemplars_main(
    locale: &DataLocale,
) -> Result<UnicodeSetData, PropertiesError>
Expand description

Get the “main” set of exemplar characters.

Enabled with the compiled_data Cargo feature.

📚 Help choosing a constructor

§Examples

use icu::locid::locale;
use icu::properties::exemplar_chars;

let data = exemplar_chars::exemplars_main(&locale!("en").into())
    .expect("locale should be present");
let exemplars_main = data.as_borrowed();

assert!(exemplars_main.contains_char('a'));
assert!(exemplars_main.contains_char('z'));
assert!(exemplars_main.contains("a"));
assert!(!exemplars_main.contains("ä"));
assert!(!exemplars_main.contains("ng"));
assert!(!exemplars_main.contains("A"));