Returns the plural form of the word.

@param string $word Word to pluralize.

@return string The plural form of `$word`.
552091
public static function plural(string $word) : string
    {
        // Check that `$word` is countable.
        if(in_array($word, Inflector::$_uncontable)) {
            return $word;
        }

        // Now check that `$word` is regular.
        if(isset(Inflector::$_plural["irregular"][$word])) {
            return Inflector::$_plural["irregular"][$word];
        }

        // Now check that `$word` can be pluralize.
        foreach(Inflector::$_plural["uninflected"] as $rule) {
            if(preg_match("/^". $rule ."$/", $word)) {
                return $word;
            }
        }

        // Now the word follows a rule, so apply it
        foreach(Inflector::$_plural["rules"] as $key => $value) {
            if(preg_match($key, $word)) {
                return preg_replace($key, $value, $word);
            }
        }

        // Well, right now the word couldn't be pluralized
        // so return it as it was (or throw an exception?)
        return $word;
    }
972777
protected function decamelize($word)
    {
        return preg_replace_callback(
            '/(^|[a-z])([A-Z])/',
            function ($matches) {
                return strtolower(strlen($matches[1]) ? $matches[1] . "_" . $matches[2] : $matches[2]);
            },
            $word
        );
    }
1334810
public static function singular($word)
    {
        $definitions = Config::getPluralDefinitions();

        if (($singular = array_search($word, $definitions)) !== false) {
            return $singular;
        }

        return LaravelStr:: singular($word);
    }
810454
protected static function toSimpleL33t($word)
	{
		$subs = array(
			'4' => 'A',
			'@' => 'A',
			'^' => 'A',
			'8' => 'B',
			'(' => 'C',
			'{' => 'C',
			'<' => 'C',
			')' => 'D',
			'3' => 'E',
			'6' => 'G',
			'9' => 'G',
			'&' => 'G',
			'#' => 'H',
			'1' => 'I',
			'!' => 'I',
			//'|' => 'I',
			'|' => 'L',
			'1' => 'L',
			'~' => 'N',
			'0' => 'O',
			'*' => 'O',
			'5' => 'S',
			'$' => 'S',
			'7' => 'T',
			'+' => 'T',
			'%' => 'Y',
			'2' => 'Z',
		);

		$word2 = str_replace(array_keys($subs), array_values($subs), $word);

		return strtolower($word2);
	}
881914
public static function pluralise($word)
    {
        // Run each rule over the word
        foreach (static::$pluralRules as $rule => $replacement) {
            if (preg_match($rule, $word)) {
                return preg_replace($rule, $replacement, $word);
            }
        }

        return $word;
    }
958811
protected function classify($word)
    {
        $s = strtolower(trim($word));
        $s = preg_replace('#([.-])(?=[a-z])#', '$1 ', $s);
        $s = preg_replace('#([._])(?=[a-z])#', '$1 ', $s);
        $s = ucwords($s);
        $s = str_replace('. ', ':', $s);

        return $s = str_replace(['_ ', '- '], '', $s);
    }
692692
public static function pluralize($word) {
        if ($word == "clicktocall") {
            return $word;
        }

        switch(strtolower($word[strlen($word) - 1])) {
        case 'y':
            return substr($word, 0, -1) . 'ies';
        case 's':
        case 'h':
        case 'x':
            return $word. 'es';
        default:
            return $word . 's';
        }
    }
137385
public function disambiguate($word)
    {
        $matches  = null;
        $contains = preg_match('/^men([aiueo])(.*)$/', $word, $matches);

        if ($contains === 1) {
            return 'n' . $matches[1] . $matches[2];
        }
    }
1160810
public static function plural($word)
    {
        if(is_array($word)) {
            $ret = [];
            foreach($word as $key => $value) {
                $ret[$key] = Str::plural($value);
            }

            return $ret;
        }

        return Inflector::plural($word);
    }
549134
public static String pluralize(String word) {
        if (word == null) {
            throw new IllegalArgumentException();
        }

        final String lowerCaseWord = word.toLowerCase();
        if (endsWithAny(lowerCaseWord, "s", "sh", "o")) {
            return word + "es";
        }
        if (lowerCaseWord.endsWith("y") &&
                !lowerCaseWord.endsWith("ay") || endsWithAny(lowerCaseWord, "ey", "oy", "uy")) {
            return word.substring(0, word.length() - 1) + "ies";
        } else {
            return word + "s";
        }
    }
906711
public static function underscore($word) {
		if (isset(static::$_underscored[$word])) {
			return static::$_underscored[$word];
		}
		return static::$_underscored[$word] = strtolower(static::slug($word, '_'));
	}
1005318
public static function singularize($word)
    {

        static::$uncountables = array(
            'equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep', 'media'
        );
        static::$irregulars = array(
            'person'  => 'people',
            'man'     => 'men',
            'child'   => 'children',
            'sex'     => 'sexes',
            'move'    => 'moves'
        );
        $lowerCasedWord = strtolower($word);
        foreach (static::$uncountables as $uncountable) {
            if (substr($lowerCasedWord, (-1 * strlen($uncountable))) == $uncountable) {
                return $word;
            }
        }
        foreach (static::$irregulars as $plural => $singular) {
            if (preg_match('/(' . $singular.')$/i', $word, $arr)) {
                return preg_replace(
                    '/(' . $singular . ')$/i',
                    substr($arr[0], 0, 1) . substr($plural, 1),
                    $word
                );
            }
        }
        foreach (static::$singulars as $rule => $replacement) {
            if (preg_match($rule, $word)) {
                return preg_replace($rule, $replacement, $word);
            }
        }

        return $word;
    }
370650
public static function pluralize(string $word): string
    {
        if (isset(static::$inflectorCache['pluralize'][$word])) {
            return static::$inflectorCache['pluralize'][$word];
        }

        if (!isset(static::$inflectorCache['irregular']['pluralize'])) {
            static::$inflectorCache['irregular']['pluralize'] = '(?:' . implode('|', array_keys(static::$irregular)) . ')';
        }

        if (preg_match('/(.*?(?:\\b|_))(' . static::$inflectorCache['irregular']['pluralize'] . ')$/i', $word, $regs)) {
            static::$inflectorCache['pluralize'][$word] = $regs[1] . substr($regs[2], 0, 1) .
                substr(static::$irregular[strtolower($regs[2])], 1);

            return static::$inflectorCache['pluralize'][$word];
        }

        if (!isset(static::$inflectorCache['uninflected'])) {
            static::$inflectorCache['uninflected'] = '(?:' . implode('|', static::$uninflected) . ')';
        }

        if (preg_match('/^(' . static::$inflectorCache['uninflected'] . ')$/i', $word, $regs)) {
            static::$inflectorCache['pluralize'][$word] = $word;

            return $word;
        }

        foreach (static::$plural as $rule => $replacement) {
            if (preg_match($rule, $word)) {
                static::$inflectorCache['pluralize'][$word] = preg_replace($rule, $replacement, $word);

                return static::$inflectorCache['pluralize'][$word];
            }
        }

        return $word;
    }
1249917
public static function singularize( $word ) {
		if ( isset( self::$cache['singularize'][ $word ] ) ) {
			return self::$cache['singularize'][ $word ];
		}

		if ( ! isset( self::$singular['merged']['uninflected'] ) ) {
			self::$singular['merged']['uninflected'] = array_merge(
				self::$singular['uninflected'],
				self::$uninflected
			);
		}

		if ( ! isset( self::$singular['merged']['irregular'] ) ) {
			self::$singular['merged']['irregular'] = array_merge(
				self::$singular['irregular'],
				array_flip( self::$plural['irregular'] )
			);
		}

		if ( ! isset( self::$singular['cacheUninflected'] ) || ! isset( self::$singular['cacheIrregular'] ) ) {
			self::$singular['cacheUninflected'] = '(?:' . join( '|', self::$singular['merged']['uninflected'] ) . ')';
			self::$singular['cacheIrregular']   = '(?:' . join( '|', array_keys( self::$singular['merged']['irregular'] ) ) . ')';
		}

		if ( preg_match( '/(.*)\\b(' . self::$singular['cacheIrregular'] . ')$/i', $word, $regs ) ) {
			self::$cache['singularize'][ $word ] = $regs[1] . substr( $word, 0, 1 ) . substr( self::$singular['merged']['irregular'][ strtolower( $regs[2] ) ], 1 );

			return self::$cache['singularize'][ $word ];
		}

		if ( preg_match( '/^(' . self::$singular['cacheUninflected'] . ')$/i', $word, $regs ) ) {
			self::$cache['singularize'][ $word ] = $word;

			return $word;
		}

		foreach ( self::$singular['rules'] as $rule => $replacement ) {
			if ( preg_match( $rule, $word ) ) {
				self::$cache['singularize'][ $word ] = preg_replace( $rule, $replacement, $word );

				return self::$cache['singularize'][ $word ];
			}
		}

		self::$cache['singularize'][ $word ] = $word;

		return $word;
	}
236333
public static 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);
    return $word;
  }
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;
	}
31514
private static function step3($word)
    {
        switch (substr($word, -2, 1)) {
            case 'a':
                self::replace($word, 'ical', 'ic', 0);
                break;

            case 's':
                self::replace($word, 'ness', '', 0);
                break;

            case 't':
                self::replace($word, 'icate', 'ic', 0)
                || self::replace($word, 'iciti', 'ic', 0);
                break;

            case 'u':
                self::replace($word, 'ful', '', 0);
                break;

            case 'v':
                self::replace($word, 'ative', '', 0);
                break;

            case 'z':
                self::replace($word, 'alize', 'al', 0);
                break;
        }

        return $word;
    }