4 CLDRPluralRuleParser is a PHP library for parsing
5 [http://cldr.unicode.org/index/cldr-spec/plural-rules](plural rules) specified in the
6 [http://cldr.unicode.org/index](CLDR project).
8 This library does not contain the rules from the CLDR project, you have to get them yourself.
10 Here is how you use it:
13 use CLDRPluralRuleParser\Evaluator;
15 // Example for English
16 $rules = ['i = 1 and v = 0'];
17 $forms = ['syntax error', 'syntax errors'];
19 for ( $i = 0; $i < 3; $i++ ) {
20 $index = Evaluator::evaluate( $i, $rules );
21 echo "This code has $i {$forms[$i]}\n";
24 // This code has 0 syntax errors
25 // This code has 1 syntax error
26 // This code has 2 syntax errors
32 The project is licensed under the GPL license 2 or later.