FOF30\Inflector\Inflector::isPlural PHP Method

isPlural() public method

Check to see if an Enlish word is plural.
public isPlural ( string $string ) : boolean
$string string String to be checked.
return boolean
    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;
    }