grammaticalnumber
v1.0.0
Published
Determining whether a number (integer or floating point) should be treated as singular, plural, or paucal. Slavic languages may treat some plural numbers as a grammatical singular, and may use a second grammatical plural, called paucal.
Downloads
7
Readme
grammaticalnumber
"1 čovjek", "3 čovjeka", "5 ljudi".
A function for determining whether a number (integer or floating point) should be treated as singular, plural, or paucal.
In Slavic languages such as Bosnian, Croatian, and Serbian, certain numbers (2, 3, 4) have a different grammatical form from other plural values. This form is called paucal.
Additionally, certain plural numbers, such as 11, are gramatically treated as singular.
The function determineGrammaticalNumber takes a positive or negative number as argument and returns one of the following strings: 'singular', 'plural', 'paucal'.
This string can then be used in determining which resource text to use with the number. In Bosnian and Croatian, one might write "1 čovjek", "3 čovjeka", or "5 ljudi".
Examples of usage:
determineGrammaticalNumber(301); // returns 'singular'
determineGrammaticalNumber(9); // returns 'plural'
determineGrammaticalNumber(23); // returns 'paucal'
Special thanks to Emina Kamenarević and Alma Sarajlić for their linguistic guidance.