Cldr v0.0.12 Cldr.Number.PluralRule.Transformer

Tranformations on the parse tree returned from parsing plural rules.

The transformations is primarily to convert the parse tree into an AST representing a cond statement that implements the rule.

Summary

Functions

Converts a map representing a set of plural rules and converts it to an cond statement

Functions

rules_to_condition_statement(rules, module)

Converts a map representing a set of plural rules and converts it to an cond statement.

rules is a map of the locale specific branch of the plurals.json file from CLDR. It is then tokenized, parsed and the resulting ast converted to a cond statement.