allegro / tradukisto

A Java i18n library created to convert numbers to their word representations.
Apache License 2.0
204 stars 92 forks source link

Some of the slavic languages can share class PluralForms #95

Closed jglaszka closed 1 year ago

jglaszka commented 1 year ago

copied from https://github.com/allegro/tradukisto/pull/65#discussion_r1252214687: I see that identical logic is in other slavic languages - russian, ukrainian, bulgarian - so this class in future could be refactored into shared one class. In polish 121 000 000 is plural (sto dwadzieścia jeden milionów), because for polish people every number over 1 is plural. It looks that in other slavic languages numbers ending on 1 (but not 11) is singular:

HR: sto dvadeset jedan milijun RU: сто двадцать один миллион UK: сто двадцять один мільйон So I think we could move polish code into PolishPluralForms and other slavic into SlavonicPluralForms.

jglaszka commented 1 year ago

I updated the test cases in https://github.com/allegro/tradukisto/pull/97/files to ensure that test cases have adequate coverage and it will detect possible regression in the future.