Expand description
This module provides APIs for getting exemplar characters for a locale.
Exemplars are characters used by a language, separated into different sets. The sets are: main, auxiliary, punctuation, numbers, and index.
The sets define, according to typical usage in the language, which characters occur in which contexts with which frequency. For more information, see the documentation in the Exemplars section in Unicode Technical Standard #35 of the LDML specification.
§Examples
use icu::locid::locale;
use icu::properties::exemplar_chars;
let locale = locale!("en-001").into();
let data = exemplar_chars::exemplars_main(&locale)
.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"));
Functions§
- Get the “auxiliary” set of exemplar characters.
- Get the “index” set of exemplar characters.
- Get the “main” set of exemplar characters.
- Get the “numbers” set of exemplar characters.
- Get the “punctuation” set of exemplar characters.
- A version of
exemplars_auxiliary()
that uses custom data provided by aDataProvider
. - A version of
exemplars_index()
that uses custom data provided by aDataProvider
. - A version of
exemplars_main()
that uses custom data provided by aDataProvider
. - A version of
exemplars_numbers()
that uses custom data provided by aDataProvider
. - A version of
exemplars_punctuation()
that uses custom data provided by aDataProvider
.