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.

Parameters

string $value

Return Value

string

static string plural(string $value, int $count = 2)

Get the plural form of the given word.

Parameters

string $value
int $count

Return Value

string

static protected string inflect(string $value, array $source, array $irregular)

Perform auto inflection on an English word.

Parameters

string $value
array $source
array $irregular

Return Value

string

static protected bool uncountable(string $value)

Determine if the given value is uncountable.

Parameters

string $value

Return Value

bool

static protected string matchCase(string $value, string $comparison)

Attempt to match the case on two strings.

Parameters

string $value
string $comparison

Return Value

string

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/4.2/Illuminate/Support/Pluralizer.html