2017 © Pedro PelĂĄez
 

library cldr-plural-rule-parser

Evaluates plural rules specified in the CLDR project notation.

image

wikimedia/cldr-plural-rule-parser

Evaluates plural rules specified in the CLDR project notation.

  • Saturday, July 28, 2018
  • by mediawiki
  • Repository
  • 21 Watchers
  • 2 Stars
  • 163,225 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 7 % Grown

The README.md

CLDRPluralRuleParser

CLDRPluralRuleParser is a PHP library for parsing plural rules specified in the CLDR project., (*1)

This library does not contain the rules from the CLDR project, you have to get them yourself., (*2)

Here is how you use it:, (*3)

use CLDRPluralRuleParser\Evaluator;

// Example for English
$rules = ['i = 1 and v = 0'];
$forms = ['syntax error', 'syntax errors'];

for ( $i = 0; $i < 3; $i++ ) {
    $index = Evaluator::evaluate( $i, $rules );
    echo "This code has $i {$forms[$index]}\n";
}

// This code has 0 syntax errors
// This code has 1 syntax error
// This code has 2 syntax errors

License

The project is licensed under the GPL license 2 or later., (*4)

The Versions

28/07 2018

dev-master

9999999-dev https://www.mediawiki.org/wiki/CLDRPluralRuleParser

Evaluates plural rules specified in the CLDR project notation.

  Sources   Download

GPL-2.0+ GPL-2.0-or-later

The Requires

  • php >=5.5.9

 

The Development Requires

by Tim Starling
by Niklas Laxström

28/08 2015

v1.0.0

1.0.0.0 https://www.mediawiki.org/wiki/CLDRPluralRuleParser

Evaluates plural rules specified in the CLDR project notation.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.3.3

 

The Development Requires

by Tim Starling
by Niklas Laxström