protected
|
|
public
Joomla\String\Inflector
|
#
addCountableRule( mixed $data )
Adds a countable word.
Parameters
- $data
mixed - $data A string or an array of strings to add.
Returns
Since
1.0
|
public
Joomla\String\Inflector
|
#
addWord( string $singular, string $plural = null )
Adds a specific singular-plural pair for a word.
Adds a specific singular-plural pair for a word.
Parameters
- $singular
string - $singular The singular form of the word.
- $plural
string - $plural The plural form of the word. If omitted, it is assumed the singular and
plural are identical.
Returns
Since
1.0
|
public
Joomla\String\Inflector
|
#
addPluraliseRule( mixed $data )
Adds a pluralisation rule.
Adds a pluralisation rule.
Parameters
- $data
mixed - $data A string or an array of regex rules to add.
Returns
Since
1.0
|
public
Joomla\String\Inflector
|
#
addSingulariseRule( mixed $data )
Adds a singularisation rule.
Adds a singularisation rule.
Parameters
- $data
mixed - $data A string or an array of regex rules to add.
Returns
Since
1.0
|
public static
Joomla\String\Inflector
|
#
getInstance( boolean $new = false )
Gets an instance of the JStringInflector singleton.
Gets an instance of the JStringInflector singleton.
Parameters
- $new
boolean - $new If true (default is false), returns a new instance regardless if one
exists. This argument is mainly used for testing.
Returns
Since
1.0
|
public
boolean
|
#
isCountable( string $word )
Checks if a word is countable.
Checks if a word is countable.
Parameters
- $word
string - $word The string input.
Returns
boolean - True if word is countable, false otherwise.
Since
1.0
|
public
boolean
|
#
isPlural( string $word )
Checks if a word is in a plural form.
Checks if a word is in a plural form.
Parameters
- $word
string - $word The string input.
Returns
boolean - True if word is plural, false if not.
Since
1.0
|
public
boolean
|
#
isSingular( string $word )
Checks if a word is in a singular form.
Checks if a word is in a singular form.
Parameters
- $word
string - $word The string input.
Returns
boolean - True if word is singular, false if not.
Since
1.0
|
public
mixed
|
#
toPlural( string $word )
Converts a word into its plural form.
Converts a word into its plural form.
Parameters
- $word
string - $word The singular word to pluralise.
Returns
mixed - An inflected string, or false if no rule could be applied.
Since
1.0
|
public
mixed
|
#
toSingular( string $word )
Converts a word into its singular form.
Converts a word into its singular form.
Parameters
- $word
string - $word The plural word to singularise.
Returns
mixed - An inflected string, or false if no rule could be applied.
Since
1.0
|