[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/languages/utils/ -> CLDRPluralRuleEvaluator.php (summary)

(no description)

File Size: 187 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

CLDRPluralRuleEvaluator:: (4 methods):
  evaluate()
  compile()
  evaluateCompiled()
  doOperation()


Class: CLDRPluralRuleEvaluator  - X-Ref

Parse and evaluate a plural rule.

UTS #35 Revision 33
http://www.unicode.org/reports/tr35/tr35-33/tr35-numbers.html#Language_Plural_Rules

evaluate( $number, array $rules )   X-Ref
Evaluate a number against a set of plural rules. If a rule passes,
return the index of plural rule.

param: int $number The number to be evaluated against the rules
param: array $rules The associative array of plural rules in pluralform => rule format.
return: int The index of the plural form which passed the evaluation

compile( array $rules )   X-Ref
Convert a set of rules to a compiled form which is optimised for
fast evaluation. The result will be an array of strings, and may be cached.

param: array $rules The rules to compile
return: array An array of compile rules.

evaluateCompiled( $number, array $rules )   X-Ref
Evaluate a compiled set of rules returned by compile(). Do not allow
the user to edit the compiled form, or else PHP errors may result.

param: string $number The number to be evaluated against the rules, in English, or it
param: array $rules The associative array of plural rules in pluralform => rule format.
return: int The index of the plural form which passed the evaluation

doOperation( $token, $left, $right )   X-Ref
Do a single operation

param: string $token The token string
param: mixed $left The left operand. If it is an object, its state may be destroyed.
param: mixed $right The right operand
return: mixed The operation result



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1