-
Notifications
You must be signed in to change notification settings - Fork 225
Discuss supported options in CollationType docs #6778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,16 +10,40 @@ enum_keyword!( | |
/// A Unicode Collation Identifier defines a type of collation (sort order). | ||
/// | ||
/// The valid values are listed in [LDML](https://unicode.org/reports/tr35/#UnicodeCollationIdentifier). | ||
/// | ||
/// # Supported Values | ||
/// | ||
/// Not all collation orderings are always supported by ICU4X: | ||
/// | ||
/// - Some apply to specific locales only | ||
/// - Some require a custom data build | ||
/// - Some are not supported at all | ||
/// | ||
/// The nature of each option is documented on a best-effort basis. | ||
/// | ||
/// When an ordering is not supported, `icu::collator` falls back to the default ordering for the locale. | ||
/// | ||
/// For a discussion of which options are supported when, see | ||
/// <https://github.com/unicode-org/icu4x/issues/6033>. | ||
/// | ||
/// For more information on how to add more orderings to a custom data build, see | ||
/// [`ExportDriver::with_additional_collations`](https://docs.rs/icu_provider_export/latest/icu_provider_export/struct.ExportDriver.html#method.with_additional_collations). | ||
CollationType { | ||
/// A previous version of the ordering, for compatibility | ||
("compat" => Compat), | ||
/// Dictionary style ordering (such as in Sinhala) | ||
("dict" => Dict), | ||
/// The default Unicode collation element table order | ||
/// | ||
/// 🛈 `icu::collator` does not support the `ducet` ordering. See [`CollationType`]. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛈 is tofu for me There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For me, too, on Apple platforms. The character seems appropriate for this purpose, though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm sure we can find an equivalent character that is more widely supported. |
||
("ducet" => Ducet), | ||
/// Recommended ordering for emoji characters | ||
/// | ||
/// 🛈 `icu::collator` supports this ordering only in the root locale. See [`CollationType`]. | ||
("emoji" => Emoji), | ||
/// European ordering rules | ||
/// | ||
/// 🛈 `icu::collator` supports this ordering only in the root locale. See [`CollationType`]. | ||
("eor" => Eor), | ||
/// Phonebook style ordering (such as in German) | ||
("phonebk" => Phonebk), | ||
|
@@ -28,8 +52,12 @@ enum_keyword!( | |
/// Pinyin ordering for Latin and for CJK characters (used in Chinese) | ||
("pinyin" => Pinyin), | ||
/// Special collation type for string search | ||
/// | ||
/// 🛈 `icu::collator` does not include search collation rules by default. See [`CollationType`]. | ||
("search" => Search), | ||
/// Special collation type for Korean initial consonant search | ||
/// | ||
/// 🛈 `icu::collator` does not include search collation rules by default. See [`CollationType`]. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, even if built by datagen, the code doesn't support the data shape for this one. See #1941. Please change this one to say something along the lines of "ICU4X does not support Korean search collations." |
||
("searchjl" => Searchjl), | ||
/// Default ordering for each language | ||
("standard" => Standard), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.