Skip to content

Conversation

@peterjanssens
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant