wapmorgan / Morphos

A morphological solution for Russian and English language written completely in PHP. Provides classes to inflect personal names, geographical names, decline and pluralize nouns, generate cardinal and ordinal numerals, spell out money amounts and time intervals. / Морфологическая библиотека для английского и русского языков. Склоняет имена собственные, названия географических объектов, склонение и плюрализация имен собственных и другое.
http://wapmorgan.github.io/Morphos/
MIT License
788 stars 105 forks source link

Fix plurality for numbers more than 100. #5

Closed alexlcdee closed 7 years ago

alexlcdee commented 7 years ago

Example of failing test:

assertEquals('домов', Plurality::pluralize('дом', 213)); // returns 'дома'

Fix: added recursive call of Plurality::getNumeralForm if $count > 100 with $count % 100.

wapmorgan commented 7 years ago

Ok, thanks for PR, but I can't accept it due to changes in code style: spaces instead of tabs, opening brace on the next line, spaces around . in string concatenations. Please, fix these problems and I'd be happy to merge it. And also it'd better be

if ($count > 100) $count %= 100;

Why we need another call?

alexlcdee commented 7 years ago

Fixed. Of course we don't need another call, simply I don't thought about it.

wapmorgan commented 7 years ago

Thanks for PR!