Skip to content
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

Add PluralRules Categories functionality #778

Closed
nordzilla opened this issue Jun 9, 2021 · 1 comment · Fixed by #789
Closed

Add PluralRules Categories functionality #778

nordzilla opened this issue Jun 9, 2021 · 1 comment · Fixed by #789
Assignees
Labels
C-pluralrules Component: Plural rules S-medium Size: Less than a week (larger bug fix or enhancement) T-core Type: Required functionality
Milestone

Comments

@nordzilla
Copy link
Member

ICU4X currently has no functionality to return an enumeration of keywords that are supported by a PluralRules object for a given locale and Cardinal/Ordinal setting.

The equivalent call that we currently use in SpiderMonkey is uplrules_getKeywords()
https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/upluralrules_8h.html#a5f8a89ec2b58323e9f96ac0bf2c13ab5

@nordzilla nordzilla added T-core Type: Required functionality S-medium Size: Less than a week (larger bug fix or enhancement) discuss-priority Discuss at the next ICU4X meeting labels Jun 9, 2021
@sffc sffc added the C-pluralrules Component: Plural rules label Jun 10, 2021
@sffc
Copy link
Member

sffc commented Jun 10, 2021

2021-06-10:

  • @Manishearth - We don't have vectors over FFI yet. You should start with the Rust side though. But on FFI, there are two ways to do this: (1) return an iterator, similar to what we do for strings (Writeable), or (2) return a custom type that wraps Vec and makes it possible to read from Vec on the other side.
  • @sffc - Should we be concerned about no_std with this API? Returning an enumeration might be better. Or an enum set?
  • @Manishearth - Or an array/struct of bools. The struct should have 6 fields, all bool.
  • @sffc - Should we use this as an opportunity to put together our story for enum set?
  • @Manishearth - I think it would make sense to have a proc macro that generates the enum set for an enum. Or a regular macro. We could use a bitvec, too (https://docs.rs/bitvec/0.22.3/bitvec/array/struct.BitArray.html). But let's start with an array of bools and make it better later.

@sffc sffc removed the discuss-priority Discuss at the next ICU4X meeting label Jun 10, 2021
@sffc sffc added this to the ICU4X 0.3 milestone Jun 10, 2021
@nordzilla nordzilla changed the title Add PluralRules GetKeywords functionality Add PluralRules Categories functionality Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-pluralrules Component: Plural rules S-medium Size: Less than a week (larger bug fix or enhancement) T-core Type: Required functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants