Pluralizer
class Pluralizer (View source)
Properties
static array | $plural | Plural word form rules. |
|
static array | $singular | Singular word form rules. |
|
static array | $irregular | Irregular word forms. |
|
static array | $uncountable | Uncountable word forms. |
|
static protected array | $pluralCache | The cached copies of the plural inflections. |
|
static protected array | $singularCache | The cached copies of the singular inflections. |
Methods
static string
singular(string $value)
Get the singular form of the given word.
static string
plural(string $value, int $count = 2)
Get the plural form of the given word.
static string
inflect(string $value, array $source, array $irregular)
Perform auto inflection on an English word.
static bool
uncountable(string $value)
Determine if the given value is uncountable.
static string
matchCase(string $value, string $comparison)
Attempt to match the case on two strings.
Details
static string
singular(string $value)
Get the singular form of the given word.
static string
plural(string $value, int $count = 2)
Get the plural form of the given word.
static protected string
inflect(string $value, array $source, array $irregular)
Perform auto inflection on an English word.
static protected bool
uncountable(string $value)
Determine if the given value is uncountable.
static protected string
matchCase(string $value, string $comparison)
Attempt to match the case on two strings.