Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, like we described in #1779 we did encounter some issues with the (dutch) ordinals not always returning correctly.
Dutch is quite different from most of the others, so I tried to fix this with, taking into account the other languages.
I provided tests for most edge cases, cross languages.
The main difference is that we cannot rely on the last digit, since we recycle on base 100, with 20 exceptions in the beginning.
Stemming on 10 did not provide the correct exception.
I disabled some asserts in the testfile because they need to be fixed within the language configurations itself. Greek for instance has apparent rules for [0,1,2] but they there list the gendered variants (male, neutral, female). Greek can probably go with one default.
There is still only one edge-case for french. They recycle the first (1,11,21,31,..). That is probably easiest handled by having the ordinal list 'incorrect' to the latter recurrent -e (onzième, vingt-et-unième,...) and do literal exception on 1 (premier/première). A bit like I had to do for our zero (nulde) where the other zeros (30ste,40ste,..100ste) follow the 'incorrect' rule for zero.
I kept the helper in TimeExpressionParser (it could also fit as a more general helper somewhere, since ordinals are not only datetime related, but I don't know if we have use-cases for ordinals elsewhere).
I did not yet do the entire refactoring for all ordinals in TEP, just for the makeCenturyString