承接 wikimedia/cldr-plural-rule-parser 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wikimedia/cldr-plural-rule-parser

最新稳定版本:v3.0.0

Composer 安装命令:

composer require wikimedia/cldr-plural-rule-parser

包简介

Evaluates plural rules specified in the CLDR project notation.

README 文档

README

CLDRPluralRuleParser is a PHP library for parsing plural rules specified in the CLDR project.

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

Here is how you use it:

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.

统计信息

  • 总下载量: 797.56k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 10
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 17
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-01-04