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§
- exemplars_
auxiliary - Get the “auxiliary” set of exemplar characters.
- exemplars_
index - Get the “index” set of exemplar characters.
- exemplars_
main - Get the “main” set of exemplar characters.
- exemplars_
numbers - Get the “numbers” set of exemplar characters.
- exemplars_
punctuation - Get the “punctuation” set of exemplar characters.
- load_
exemplars_ auxiliary - A version of
exemplars_auxiliary()
that uses custom data provided by aDataProvider
. - load_
exemplars_ index - A version of
exemplars_index()
that uses custom data provided by aDataProvider
. - load_
exemplars_ main - A version of
exemplars_main()
that uses custom data provided by aDataProvider
. - load_
exemplars_ numbers - A version of
exemplars_numbers()
that uses custom data provided by aDataProvider
. - load_
exemplars_ punctuation - A version of
exemplars_punctuation()
that uses custom data provided by aDataProvider
.