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

Collation case level examples debug #2472

Closed
echeran opened this issue Aug 29, 2022 · 4 comments
Closed

Collation case level examples debug #2472

echeran opened this issue Aug 29, 2022 · 4 comments
Labels
C-collator Component: Collation, normalization S-medium Size: Less than a week (larger bug fix or enhancement) T-bug Type: Bad behavior, security, privacy

Comments

@echeran
Copy link
Contributor

echeran commented Aug 29, 2022

When creating docs examples for the case level setting in collation options for collator (#2447), I couldn't seem to create examples that returned distinct outputs from primary strength versus secondary strength.

The examples in #2447 are adapted from the examples provided in the ICU User Guide for case level, partly due to not being able to get the code to produce the output expected based on the User Guide.

Is the application of case-level in collation broken? Or is it a problem of not knowing how to use it?

@echeran echeran added T-bug Type: Bad behavior, security, privacy S-medium Size: Less than a week (larger bug fix or enhancement) C-collator Component: Collation, normalization labels Aug 29, 2022
@echeran echeran added this to the ICU4X 1.x Untriaged milestone Aug 29, 2022
@echeran echeran changed the title Collation strength examples debug Collation case level examples debug Aug 29, 2022
@markusicu
Copy link
Member

I suggest you try this list of strings and compare each with the next:

  • ⓓⓔⓐⓛ
  • DEAL
  • dejavu
  • dejAvu
  • déjavu

The last two trade places in the sort order depending on the settings:

  • primary+case ignores the accent difference so dejAvu will compare greatest
  • secondary+case has the accent difference win over the case difference

This is a bug:

assert_eq!(primary_and_case.compare("DEAL", "ⓓⓔⓐⓛ"), Ordering::Equal);

This should yield Greater.

@echeran
Copy link
Contributor Author

echeran commented Aug 30, 2022

@markusicu - Thanks! I incorporated some of that into PR #2447.

Note to self/others: Leave this issue open for the bug identified in the comment above.

@markusicu
Copy link
Member

markusicu commented Aug 31, 2022

@markusicu - Thanks! I incorporated some of that into PR #2447.

Nice.

Note to self/others: Leave this issue open for the bug identified in the comment above.

That is now visible on two lines in the above PR:

//! assert_eq!(primary_and_case.compare("ⓓⓔⓐⓛ", "DEAL"), Ordering::Equal);
...
//! assert_eq!(primary_and_case.compare("déjavu", "dejAvu"), Ordering::Equal);

@echeran
Copy link
Contributor Author

echeran commented Dec 17, 2022

This issue was reported again in #2884 , which was fixed by #2892. Closing this as duplicated and fixed.

@echeran echeran closed this as completed Dec 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-collator Component: Collation, normalization S-medium Size: Less than a week (larger bug fix or enhancement) T-bug Type: Bad behavior, security, privacy
Projects
None yet
Development

No branches or pull requests

2 participants