Gets an inflected word from the cache where the plural form is supplied.

@param   string  $plural  A plural form of a word.

@return  mixed  The cached inflection or false if none found.

@since   1.0
545853
private function getCachedSingular($plural)
	{
		$plural = String::strtolower($plural);

		return array_search($plural, $this->cache);
	}
1085284
public static function pluralToSingular($pluralWordToCheck) {
        $listOfSingular = [
            'categories'    => 'category',
            'kb_item'       => 'knowledge base item',
            'list_email'    => 'email list',
            'listlist'      => 'list',
            'people'        => 'person',
            'peoples'       => 'person',
            'social'        => 'social site',
            'todo_item'     => 'to do item',
            'email_message' => 'email message',
        ];

        foreach ($listOfSingular as $plural => $singular) {

            if (strtolower($pluralWordToCheck) == strtolower($plural)) {
                return $singular;
            }
        }

        return $pluralWordToCheck;
    }
183364
public static function pluralize($input) {
		if (self::$pluralizer === null) {
			self::$pluralizer = new StandardEnglishSingularizer();
		}

		return self::$pluralizer->getPluralForm($input);
	}
594539
public static function pluralize($word)
        {
            if (isset(static::$_pluralized[$word])) {
                return static::$_pluralized[$word];
            }

            extract(static::$_plural);

            if (!isset($regexUninflected) || !isset($regexIrregular)) {
                $regexUninflected = static::_enclose(join('|', $uninflected + static::$_uninflected));
                $regexIrregular = static::_enclose(join('|', array_keys($irregular)));

                static::$_plural += compact('regexUninflected', 'regexIrregular');
            }

            if (preg_match('/(' . $regexUninflected . ')$/i', $word, $regs)) {
                return static::$_pluralized[$word] = $word;
            }

            if (preg_match('/(.*)\\b(' . $regexIrregular . ')$/i', $word, $regs)) {
                $plural = substr($word, 0, 1) . substr($irregular[static::lower($regs[2])], 1);

                return static::$_pluralized[$word] = $regs[1] . $plural;
            }

            foreach ($rules as $rule => $replacement) {
                if (preg_match($rule, $word)) {
                    return static::$_pluralized[$word] = preg_replace($rule, $replacement, $word);
                }
            }

            return static::$_pluralized[$word] = $word;
        }
586667
protected function _pluralToSingular($str)
    {
        if ($str[strlen($str) - 1] !== 's') {
            return false;
        }

        //https://github.com/UlvHare/PHPixie-demo/blob/d000d8f11e6ab7c522feeb4457da5a802ca3e0bc/vendor/phpixie/orm/src/PHPixie/ORM/Configs/Inflector.php
        if (preg_match('#^(.*?us)$|(.*?[sxz])es$|(.*?[^aeioudgkprt]h)es$#', $str, $match)) {
            return $match[1];
        } elseif (preg_match('#^(.*?[^aeiou])ies$#', $str, $match)) {
            return $match[1] . 'y';
        } else {
            return substr($str, 0, -1);
        }
    }
220599
public static function pluralize($word) {
        if ('' === $word || null === $word) {
            return false;
        }
        $plural = array(
            '/(quiz)$/i'               => '$1zes',
            '/^(ox)$/i'                => '$1en',
            '/([m|l])ouse$/i'          => '$1ice',
            '/(matr|vert|ind)ix|ex$/i' => '$1ices',
            '/(x|ch|ss|sh)$/i'         => '$1es',
            '/([^aeiouy]|qu)ies$/i'    => '$1y',
            '/([^aeiouy]|qu)y$/i'      => '$1ies',
            '/(hive)$/i'               => '$1s',
            '/(?:([^f])fe|([lr])f)$/i' => '$1$2ves',
            '/sis$/i'                  => 'ses',
            '/([ti])um$/i'             => '$1a',
            '/(buffal|tomat)o$/i'      => '$1oes',
            '/(bu)s$/i'                => '$1ses',
            '/(alias|status)/i'        => '$1es',
            '/(octop|vir)us$/i'        => '$1i',
            '/(ax|test)is$/i'          => '$1es',
            '/s$/i'                    => 's',
        );

        $uncountableNouns = [
            'air',
            'anger',
            'beauty',
            'equipment',
            'evidence',
            'fish',
            'information',
            'knowledge',
            'love',
            'money',
            'news',
            'research',
            'rice',
            'safety',
            'series',
            'sheep',
            'species',
            'sugar',
            'tea',
            'water',
        ];

        $irregular = [
            'child'  => 'children',
            'leaf'   => 'leaves',
            'man'    => 'men',
            'move'   => 'moves',
            'person' => 'people',
            'sex'    => 'sexes',
        ];

        $lowerWord = strtolower($word);
        foreach ($uncountableNouns as $noun) {
            if (substr($lowerWord, -strlen($noun)) === $noun) {
                return $word . '_list';
            }
        }

        foreach ($irregular as $_singular => $_plural) {
            $length = strlen($_singular);
            if (substr($lowerWord, -$length) === $_singular) {
                return substr($word, 0, -$length) . $_plural;
            }
        }

        foreach ($plural as $search => $replacement) {
            if (($r = preg_replace($search, $replacement, $word)) !== $word) {
                return $r;
            }
        }
        return $word . 's';
    }
414488
public function getPluralTitle()
    {
        if (!isset($this->pluralTitle) || !$this->pluralTitle) {
            return Str::plural($this->getTitle());
        }

        return $this->pluralTitle;
    }
223037
public static function addWord($singular, $plural)
    {
        self::$_cache['pluralized'][$singular]	= $plural;
        self::$_cache['singularized'][$plural] 	= $singular;

        self::$_cache['singularized'][$singular] = $singular;
        self::$_cache['pluralized'][$plural] = $plural;
    }
1153082
public function getEntityName($plural = false)
    {
        $entityClassName = $this->getEntityClassName();
        if ($entityClassName !== null) {
            $entityName = ObjectHelper::class_basename($entityClassName);
        } else {
            $entityName = ObjectHelper::class_basename($this);
        }

        if ($plural) {
            return StringHelper::plural($entityName, is_numeric($plural) ? $plural : 2);
        } else {
            return $entityName;
        }
    }
424868
public function ngettext($singular, $plural, $count) {
		if ($this->reader === null) {
			return $count > 1 ? $plural : $singular;
		}
		return $this->reader->ngettext((string)$singular, (string)$plural, $count);
	}
24545
public function inflectNounByNumber($number, $singular, $plural, $genitivePlural)
    {
        $units = $number % 10;
        $tens = ((int) ($number / 10)) % 10;

        if ($number === 1) {
            return $singular;
        }

        if ($tens === 1 && $units > 1) {
            return $genitivePlural;
        }

        if ($units >= 2 && $units <= 4) {
            return $plural;
        }

        return $genitivePlural;
    }
237525
def get_plural_name(cls):
        
        if not hasattr(cls.Meta, 'plural_name'):
            setattr(
                cls.Meta,
                'plural_name',
                inflection.pluralize(cls.get_name())
            )
        return cls.Meta.plural_name
1034027
public function pluralize ($word) {
		$word .= 's';
		$word = preg_replace ('/(x|ch|sh|ss])s$/', '\1es', $word);
		$word = preg_replace ('/ss$/', 'ses', $word);
		$word = preg_replace ('/([ti])ums$/', '\1a', $word);
		$word = preg_replace ('/sises$/', 'ses', $word);
		$word = preg_replace ('/([^aeiouy]|qu)ys$/', '\1ies', $word);
		$word = preg_replace ('/(?:([^f])fe|([lr])f)s$/', '\1\2ves', $word);
		$word = preg_replace ('/ieses$/', 'ies', $word);
		if (isset ($this->pleural_corrections[$word])) {
			return $this->pleural_corrections[$word];
		}
		return $word;
	}
383562
public function gettext_select_plural_form($count)
    {
        if (!isset($this->_gettext_select_plural_form)
            || is_null($this->_gettext_select_plural_form)) {
            list($nplurals, $expression) = $this->nplurals_and_expression_from_header($this->get_header('Plural-Forms'));
            $this->_nplurals = $nplurals;
            $this->_gettext_select_plural_form = $this->make_plural_form_function($nplurals, $expression);
        }

        return call_user_func($this->_gettext_select_plural_form, $count);
    }
14808
public static function extractPluralsForms($header)
    {
        $headers = explode("\n", $header);
        $expr = 'nplurals=2; plural=n == 1 ? 0 : 1;';
        foreach ($headers as $header) {
            if (stripos($header, 'Plural-Forms:') === 0) {
                $expr = substr($header, 13);
            }
        }

        return $expr;
    }
172787
public static function pluralize($word) {
        foreach(self::$_exceptions as $exception) {
			if($exception['singular'] == $word){
				return $exception['plural'];
			}
        }

        return parent::pluralize($word);
	}
3774
private function pluralize($singular)
    {
        if (null === $this->pluralizer) {
            return $singular;
        }

        return call_user_func($this->pluralizer, $singular);
    }