public function isPlural($string)
{
// Uncountable objects are always singular (e.g. information)
if (in_array($string, $this->rules['uncountable'])) {
return false;
}
// Check cache assuming the string is singular.
$plural = isset($this->cache['pluralized'][$string]) ? $this->cache['pluralized'][$string] : null;
$singular = $plural && isset($this->cache['singularized'][$plural]) ? $this->cache['singularized'][$plural] : null;
if ($plural && $singular) {
return $singular != $string;
}
// If string is not in the cache, try to singularize and pluralize it.
return self::pluralize(self::singularize($string)) == $string;
}