icu_properties::exemplar_chars

Function exemplars_index

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

Get the “index” 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_index(&locale!("en").into())
    .expect("locale should be present");
let exemplars_index = data.as_borrowed();

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