-
Notifications
You must be signed in to change notification settings - Fork 122
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
De ordinals #1724
De ordinals #1724
Conversation
This PR should solve the german part of #669. |
@Bantolomeus thanks for the PR! Looking at the code I would suggest a change in how it is done. Let me elaborate on that:
So my proposal is to do something like: companion object {
private val NUM_TO_ORD: Array<String> = arrayOf(
"", // index 0 (invalid)
// ...
"zwölfte", // index 12 (no need to do the replace `oe` to `ö`)
// ...
)
private val ORD_TO_NUM: Map<String, Int> = ORD_TO_NUM.mapIndexed { index, s -> s to index }.toMap()
} Then accessing the array can be done with |
@soywiz I hope deleting |
Can add some tests covering these German locale ordinals? |
sure |
I will add the tests either later today or tomorrow. |
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #1724 +/- ##
==========================================
+ Coverage 50.95% 50.98% +0.03%
==========================================
Files 1728 1730 +2
Lines 100996 101122 +126
Branches 14341 14352 +11
==========================================
+ Hits 51458 51561 +103
- Misses 45587 45626 +39
+ Partials 3951 3935 -16
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
I could not come up with a good test for the ordinals so I copied your english one. But that is kinda useless, since it does exactly the same as the german ordinal code since I can not add a suffix to the german ordinals. |
Looks good to me. |
Thanks for Guiding me through it. It was my pleasure and my very first open source contribution =D |
The native windows Test failed, but it do not understand what the error is, something with coroutines, but nothing concrete. Was the Test flaky? |
It is flaky indeed. Nothing to do with this code. I have re-run it, and likely will be merged now. |
I appreciate a review of the code. It feels not right to write down all 32 cases as enum, but german ordinals are partly irregular up to 19. I could not come up with a better solution.