|
|
@ -28,13 +28,14 @@ class StringHelper |
|
|
|
public static function pluralize($name) |
|
|
|
public static function pluralize($name) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$rules = array( |
|
|
|
$rules = array( |
|
|
|
'/move$/i' => 'moves', |
|
|
|
'/(m)ove$/i' => '\1oves', |
|
|
|
'/foot$/i' => 'feet', |
|
|
|
'/(f)oot$/i' => '\1eet', |
|
|
|
'/child$/i' => 'children', |
|
|
|
'/(c)hild$/i' => '\1hildren', |
|
|
|
'/human$/i' => 'humans', |
|
|
|
'/(h)uman$/i' => '\1umans', |
|
|
|
'/man$/i' => 'men', |
|
|
|
'/(m)an$/i' => '\1en', |
|
|
|
'/tooth$/i' => 'teeth', |
|
|
|
'/(s)taff$/i' => '\1taff', |
|
|
|
'/person$/i' => 'people', |
|
|
|
'/(t)ooth$/i' => '\1eeth', |
|
|
|
|
|
|
|
'/(p)erson$/i' => '\1eople', |
|
|
|
'/([m|l])ouse$/i' => '\1ice', |
|
|
|
'/([m|l])ouse$/i' => '\1ice', |
|
|
|
'/(x|ch|ss|sh|us|as|is|os)$/i' => '\1es', |
|
|
|
'/(x|ch|ss|sh|us|as|is|os)$/i' => '\1es', |
|
|
|
'/([^aeiouy]|qu)y$/i' => '\1ies', |
|
|
|
'/([^aeiouy]|qu)y$/i' => '\1ies', |
|
|
|