Implementing CLDR plural rules
ed.trager at gmail.com
Fri Oct 16 14:03:59 CDT 2015
Excellent, Cameron, I will definitely take a look!
And thanks, Mark Davis, I will also take a look at what ICU looks like.
On Fri, Oct 16, 2015 at 1:23 PM, Cameron Dutro <cameron at lumoslabs.com>
> Hey Ed,
> I recently wrote a parser in Ruby for the plurals syntax (called
> cldr-plurals <https://github.com/camertron/cldr-plurals>) and released it
> open-source. The project contains two emitters - one for Ruby and one for
> any language, C++ included. I would welcome a pull request if you'd care to
> contribute. If nothing else, the project can serve as an example
> implementation should you decide to write your own version. ICU can of
> course serve you in a similar capacity.
> The code emitted by the cldr-plurals emitters requires a runtime capable
> of producing the n, i, v, w, f, and t variables you mentioned, to the level
> as separate projects and can also be used as a reference when developing
> your own C++ version. Here's
> the Ruby runtime, and here's
> On Fri, Oct 16, 2015 at 11:20 AM, Ed Trager <ed.trager at gmail.com> wrote:
>> Hi, List,
>> The Unicode Technical Report #35 describes operands that are used for
>> defining the rules used for determining plural forms in different languages
>> These operands are defined in table 5.1.1 of that report. These operands
>> ( n, i, v, w, f, and t ) describe not only the numeric value but also the
>> *_formatted appearance_* of the numeric value when, for example, fractional
>> decimal digits are present. For example, "v" describes the "number of
>> visible fraction digits in n, with trailing zeros".
>> My question is: Does any production system exist (e.g., some newer
>> version of ICU perhaps?) or has anyone on GitHub or elsewhere implemented a
>> system which follows these rules to this level of detail?
>> In my cursory glance on Github, I see that there are some projects which
>> purport to automatically convert the CLDR XML source to code, but I think
>> at least some of these only deal with the operand "n" and aspire only to
>> the standard GNU "gettext" internationalization library's quality of plural
>> definitions. Also, in my cursory glance on GitHub, I did not see any C++
>> class libraries which implement the CLDR style of plural definitions.
>> I am in fact thinking of writing my own C++ class implementation, so
>> that's why I am asking. From what I can tell, the STL C++ facet stuff also
>> does not implement CLDR-style plural rules; is this assumption correct?
>> CLDR-Users mailing list
>> CLDR-Users at unicode.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the CLDR-Users