php/WP_CLI/Inflector.php
public static function pluralize( $word ) {
		if ( isset( self::$cache['pluralize'][ $word ] ) ) {
			return self::$cache['pluralize'][ $word ];
		}

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

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

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

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

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

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

			return $word;
		}

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

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

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

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

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

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

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

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

			return $word;
		}

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

				return self::$cache['pluralize'][ $word ];
			}
		}
	}
public static function pluralize ( $ word ) { if ( isset ( self :: $ cache [ 'pluralize' ] [ $ word ] ) ) { return self :: $ cache [ 'pluralize' ] [ $ word ] ; } if ( ! isset ( self :: $ plural [ 'merged' ] [ 'irregular' ] ) ) { self :: $ plural [ 'merged' ] [ 'irregular' ] = self :: $ plural [ 'irregular' ] ; } if ( ! isset ( self :: $ plural [ 'merged' ] [ 'uninflected' ] ) ) { self :: $ plural [ 'merged' ] [ 'uninflected' ] = array_merge ( self :: $ plural [ 'uninflected' ] , self :: $ uninflected ) ; } if ( ! isset ( self :: $ plural [ 'cacheUninflected' ] ) || ! isset ( self :: $ plural [ 'cacheIrregular' ] ) ) { self :: $ plural [ 'cacheUninflected' ] = '(?:' . implode ( '|' , self :: $ plural [ 'merged' ] [ 'uninflected' ] ) . ')' ; self :: $ plural [ 'cacheIrregular' ] = '(?:' . implode ( '|' , array_keys ( self :: $ plural [ 'merged' ] [ 'irregular' ] ) ) . ')' ; } if ( preg_match ( '/(.*)\\b(' . self :: $ plural [ 'cacheIrregular' ] . ')$/i' , $ word , $ regs ) ) { self :: $ cache [ 'pluralize' ] [ $ word ] = $ regs [ 1 ] . substr ( $ word , 0 , 1 ) . substr ( self :: $ plural [ 'merged' ] [ 'irregular' ] [ strtolower ( $ regs [ 2 ] ) ] , 1 ) ; return self :: $ cache [ 'pluralize' ] [ $ word ] ; } if ( preg_match ( '/^(' . self :: $ plural [ 'cacheUninflected' ] . ')$/i' , $ word , $ regs ) ) { self :: $ cache [ 'pluralize' ] [ $ word ] = $ word ; return $ word ; } foreach ( self :: $ plural [ 'rules' ] as $ rule => $ replacement ) { if ( preg_match ( $ rule , $ word ) ) { self :: $ cache [ 'pluralize' ] [ $ word ] = preg_replace ( $ rule , $ replacement , $ word ) ; return self :: $ cache [ 'pluralize' ] [ $ word ] ; } } }
Returns a word in plural form.

@param string $word The word in singular form.

@return string The word in plural form.
Returns a word in plural form .