Get the plural form of an English word.

@param  string  $value
@param  int     $count
@return string
199961
public static function plural($value, $count = 2)
    {
        if (($count === 1) || static::uncountable($value)) {
            return $value;
        }

        $plural = Inflector::pluralize($value);

        return static::matchCase($plural, $value);
    }
1135145
public function pluralize(string $word, int $number = 2): string
    {
        return abs($number) === 1 ? $word : Inflector::pluralize($word);
    }
1058526
def pluralize(locale, entry, count)
      return entry unless entry.is_a?(Hash) and count
      key = :zero if count == 0 && entry.has_key?(:zero)
      key ||= count <= 1 ? :one : :other
      raise InvalidPluralizationData.new(entry, count) unless entry.has_key?(key)
      entry[key]
    end
330159
public function npgettext($context, $original, $plural, $value)
    {
        return $this->dnpgettext($this->domain, $context, $original, $plural, $value);
    }
6615
private function formatCommaSeparated($collection, $count)
    {
        $display = \array_map(function ($element) {
            return (string) $element;
        }, \array_slice($collection, 0, $count - 1));

        return $this->translator->trans('comma_separated', [
            '%list%' => \implode(', ', $display),
            '%last%' => (string) \end($collection),
        ], $this->catalogue);
    }
1168873
def pluralize(count, item_type):
  
  def pluralize_string(x):
    if x.endswith('s'):
      return x + 'es'
    else:
      return x + 's'

  text = '{} {}'.format(count, item_type if count == 1 else pluralize_string(item_type))
  return text
700786
public static function getWords($sentence, $count = 10) {
        $sentence = str_replace("\r", '', str_replace("\n", '', trim(strip_tags($sentence))));
        $words = explode(' ', $sentence);

        if (count($words) <= $count) {
            return $sentence;
        }

        $trimmed = '';
        for ($i = 0; $i < $count; $i++) {
            $trimmed .= $words[$i] . ' ';
        }

        $trimmed = trim($trimmed);

        return $trimmed;
    }
1334679
public static function Plural($number, $one, $two, $five)
  {
    $form = $number % 10 == 1 && $number % 100 != 11
      ? $one
      : ($number % 10 >= 2 && $number % 10 <= 4 && ($number % 100 < 10 || $number % 100 >= 20)
        ? $two
        : $five);

    return sprintf($form, $number);
  }
47920
public static function wordsToNumber($value = "") {

        // if value passed as empty or is not a string then return false
        if (!$value) {
            return false;
        }

        /** @var string $cache Cache Value */
        $cache = self::cacheString($value);

        // check for cache
        if (isset(static::$wordsToNumberCache[$cache])) {
            return static::$wordsToNumberCache[$cache];
        }

        // Replace all number words with an equivalent numeric value
        $value = strtr(
            $value, array_merge(array_flip(Numbers::toWordDictionary()), ['and' => ''])
        );

        // Coerce all tokens to numbers
        $parts = array_map(
            /**
             * @param  string $val
             * @return float
             */
            function ($val) {
                return floatval($val);
            },
            preg_split('/[\s-]+/', $value)
        );

        $stack = new \SplStack; // Current work stack
        $sum   = 0; // Running total
        $last  = null;
        foreach ($parts as $part) {
            if (!$stack->isEmpty()) {
                // We're part way through a phrase
                if ($stack->top() > $part) {
                    // Decreasing step, e.g. from hundreds to ones
                    if ($last >= 1000) {
                        // If we drop from more than 1000 then we've finished the phrase
                        $sum += $stack->pop();
                        // This is the first element of a new phrase
                        $stack->push($part);
                    } else {
                        // Drop down from less than 1000, just addition
                        // e.g. "seventy one" -> "70 1" -> "70 + 1"
                        $stack->push($stack->pop() + $part);
                    }
                } else {
                    // Increasing step, e.g ones to hundreds
                    $stack->push($stack->pop() * $part);
                }
            } else {
                // This is the first element of a new phrase
                $stack->push($part);
            }

            // Store the last processed part
            $last = $part;
        }
        return static::$wordsToNumberCache[$cache] = $sum + $stack->pop();
    }
1155907
public function sp($singular, $plural, $count, $autoTranslate = false) {
		if ((int)$count !== 1) {
			$result = $plural;
		} else {
			$result = $singular;
		}

		if ($autoTranslate) {
			$result = __($result);
		}
		return $result;
	}
1241724
public function npgettext($context, $original, $plural, $value)
    {
        $message = $context."\x04".$original;
        $translation = ngettext($message, $plural, $value);

        return ($translation === $message) ? $original : $translation;
    }
720983
protected function getTitleString($titles, $count)
    {
        $limit      = $this->getLimit();
        $okCount    = count($titles);
        $missing    = $count - $okCount;
        $andCount   = max([0, $okCount - $limit]) + $missing;

        if (!$okCount) {
            list($singular, $plural) = $this->getTypeLabelVariations($count);
            return $this->formatPlural($count, $singular, $plural);
        }
        if ($count < 2) {
            return reset($titles);
        }
        if ($okCount === 2 && !$andCount) {
            return $this->t("@name1 and @name2", array_combine(['@name1', '@name2'], $titles));
        }

        if ($limit < $okCount) {
            $titles = array_slice($titles, 0, $limit);
        }

        $ret = implode(", ", $titles);

        if ($andCount) {
            $ret .= ' ' . $this->formatPlural($andCount, "and @count more", "and @count more");
        }

        return $ret;
    }
272748
public function deleteLast($value, int $count = 1): int
    {
        return $this->handle->lRem($this->name, $value, -$count);
    }
668872
public function getPluralSuffixes($count)
	{
		if ($this->callbacks['pluralSuffixes'] !== null)
		{
			return call_user_func($this->callbacks['pluralSuffixes'], $count);
		}
		else
		{
			return array((string) $count);
		}
	}
571806
protected function inflect(array $plurals, $value, $rdc = null)
    {
        foreach ($plurals as $pattern => $repl) {
            if (preg_match($pattern, $value)) {
                return preg_replace($pattern, $repl, $value);
            }
        }

        return null === $rdc ? $value : (self::REDUCE === $rdc ? $this->reduceVal($value) : $this->appendVal($value));
    }
1153034
public static function sentences($count = 3)
    {
        $sentences = array();
        for ($i = 0; $i < $count; $i++) {
            $sentences[] = static::sentence();
        }

        return $sentences;
    }
795348
public static function plural($string)
    {
        $result = $string;
        foreach (self::$_plural as $rule => $replacement) {
            $rule = self::_normalize($rule);
            if (preg_match($rule, $string)) {
                $result = preg_replace($rule, $replacement, $string);
                break;
            }
        }
        return $result;
    }