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

Predicate functions for General_Category #1158

Closed
echeran opened this issue Oct 7, 2021 · 0 comments · Fixed by #1310
Closed

Predicate functions for General_Category #1158

echeran opened this issue Oct 7, 2021 · 0 comments · Fixed by #1310
Assignees
Labels
C-unicode Component: Props, sets, tries S-small Size: One afternoon (small bug fix or enhancement) T-core Type: Required functionality

Comments

@echeran
Copy link
Contributor

echeran commented Oct 7, 2021

For use cases in which we want to request the General_Category property value for a given code point (ex: iterating through text per-code point), we should provide predicate functions that allow the user to query whether the returned property value is included in the multi-category values.

The General_Category property value describes the 30 "simple" property values (Uppercase_Letter, Lowercase_Letter, ...), which are the what is returned for the first API described above.

The multi-category values (also described as "derived" values) are logically set unions of other General_Category values (Cased_Letter, Letter, Mark, ...). Just like in ICU, we need predicate functions that correspond to each multi-category value (is_cased_letter(...) -> bool, is_letter(...) -> bool, ...) that return a boolean when the input belongs to the corresponding logical set.

@echeran echeran added T-core Type: Required functionality C-unicode Component: Props, sets, tries S-small Size: One afternoon (small bug fix or enhancement) labels Oct 7, 2021
@echeran echeran added this to the ICU4X 0.4 milestone Oct 7, 2021
@echeran echeran self-assigned this Oct 7, 2021
@sffc sffc modified the milestones: ICU4X 0.4, 2021 Q4 0.5 Sprint A Oct 21, 2021
@echeran echeran linked a pull request Nov 17, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-unicode Component: Props, sets, tries S-small Size: One afternoon (small bug fix or enhancement) T-core Type: Required functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants