Choose the plural variant

@param  int   $number
@param  array
@return string
977930
public function choose($number, array $variants, $locale = null) {
		if ($locale === null) {
			$locale = $this->getLocale();
		} else {
			$locale = $this->normalizeLocale($locale);
		}
		
		if (! isset(self::$rulesMap[$locale])) {
			$position = 0;
		} else {
			$rule     = self::$rulesMap[$locale];
			$position = $this->$rule((int) $number);
		}
		
		if (! isset($variants[$position])) {
			throw new InvalidOptions('There is no variant by position: "' . $position . '"');
		}
		
		return $variants[$position];
	}
331325
public static function normalizeNumber($number): string
    {
        $number = str_replace([',', ' '], ['.', ''], (string)$number);

        if (
            (($e = strrchr($number, 'e')) !== false) ||
            (($e = strrchr($number, 'E')) !== false)
        ) {
            $number = number_format((float)$number, -intval(substr($e, 1)));
        }

        return $number;
    }
747331
public function convertToTriplets($number)
    {
        $triplets = [];

        while ($number > 0) {
            $triplets[] = $number % 1000;
            $number = (int) ($number / 1000);
        }

        return array_reverse($triplets);
    }
1316522
private function getPluralRule($number)
    {
        // One
        if ($number === Dictionary::$thresholdFew) {
            return 'o';
        }

        // Zero, which behaves like few
        if ($number === 0) {
            return 'f';
        }

        $uz = $number % 100;

        // Hundreds behave like many
        if ($uz === 0) {
            return 'm';
        }

        // Many
        if ($uz > Dictionary::$thresholdMany) {
            return 'm';
        }

        // Below the many threshold, so few
        return 'f';
    }
188297
private function selectString($n)
    {
        if (is_null($this->pluralexpression)) {
            $this->pluralexpression = new ExpressionLanguage();
        }
        try {
            $plural = $this->pluralexpression->evaluate(
                $this->getPluralForms(),
                ['n' => $n]
            );
        } catch (\Exception $e) {
            $plural = 0;
        }

        if ($plural >= $this->pluralcount) {
            $plural = $this->pluralcount - 1;
        }

        return $plural;
    }
1058717
public function parseNumber($number)
    {
        if (is_null($number)) {
            return '';
        }

        $matches = $this->execute($this->completePhoneRegex, $number);

        if (sizeof($matches) > 1) {
            return "({$matches['code']})-{$matches['trio']}-{$matches['rest']}";
        }

        return '';
    }
452591
public function transformToWords($number)
    {
        $units = $number % 10;
        $tens = (int) ($number / 10) % 10;
        $hundreds = (int) ($number / 100) % 10;
        $words = [];

        if ($hundreds > 0) {
            $words[] = $this->dictionary->getCorrespondingHundred($hundreds);
        }

        if ($tens === 1) {
            $words[] = $this->dictionary->getCorrespondingTeen($units);
        }

        if ($tens > 1) {
            $words[] = $this->dictionary->getCorrespondingTen($tens);
        }

        if ($units > 0 && $tens !== 1) {
            $words[] = $this->dictionary->getCorrespondingUnit($units);
        }

        return implode(' ', $words);
    }
883864
public static function ordinalize($number)
    {
        if (in_array(($number % 100), range(11, 13))) {
            return $number . 'th';
        }
        switch ($number % 10) {
            case 1:
                return $number . 'st';
            case 2:
                return $number . 'nd';
            case 3:
                return $number . 'rd';
            default:
                return $number . 'th';
        }
    }
510494
protected function format($number, $oneWord, $typeWords)
    {
        $typeWord = $typeWords[$this->pluralization($number)];
        if ($number === 1) {
            $number = $oneWord;
        }
        return $this->pre_word . ' ' . $number . ' ' . $typeWord;
    }
1261485
public function toRoman($number)
    {
        $number = (int)$number;
        $roman = '';
        foreach ($this->getRomanValues() as $romanValue => $numberValue) {
            $roman .= str_repeat($romanValue, floor($number / $numberValue));
            $number = $number % $numberValue;
        }
        foreach ($this->getRomanExceptions() as $replaceThis => $withThis) {
            $roman = str_replace($replaceThis, $withThis, $roman);
        }
        return $roman;
    }
817712
public function parse($number, $options = [])
    {
        return $this->formatter()->parse($number,
            $this->mergeOptions($options)
        );
    }
259806
private function numberToNumerals($number, array $numerals)
    {
        $string = '';

        while ($number > 0) {
            foreach ($numerals as $n => $t) {
                if ($number >= $n) {
                    $string .= $t;
                    $number -= $n;
                    break;
                }
            }
        }

        return $string;
    }
1135145
public function pluralize(string $word, int $number = 2): string
    {
        return abs($number) === 1 ? $word : Inflector::pluralize($word);
    }
1293804
public String pluralize(String word, int number) {
    if (number == 1) { return word; }
    Matcher matcher = pattern.matcher(word);
    if (matcher.matches()) {
      String pre = matcher.group(1);
      String trimmedWord = matcher.group(2);
      String post = matcher.group(3);
      String plural = pluralizeInternal(trimmedWord);
      if (plural == null) { return fallbackPluralizer.pluralize(word, number); }
      return pre + postProcess(trimmedWord, plural) + post;
    }
    return word;
  }
1294913
public function toWords($number)
    {
        if ($number === 0) {
            return $this->dictionary->getZero();
        }

        $words = [];

        if ($number < 0) {
            $words[] = $this->dictionary->getMinus();
            $number *= -1;
        }

        if (null !== $this->tripletTransformer || null !== $this->powerAwareTripletTransformer) {
            $words = array_merge($words, $this->getWordsBySplittingIntoTriplets($number));
        }

        return trim(implode($this->wordsSeparator, $words));
    }
913893
public static function format($number, array $options = []) {
		$defaults = [
			'positive' => '+', 'signed' => false
		];
		$options += $defaults;
		$sign = '';
		if ($number > 0 && !empty($options['signed'])) {
			$sign = '+';
		}
		if (isset($options['signed'])) {
			unset($options['signed']);
		}
		return $sign . parent::format($number, $options);
	}
907498
public static function numberToChinese($number)
    {
        $chineseArr = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十'];
        $chineseStr = null;
        if ($number < 10) {
            $chineseStr = $chineseArr [$number - 1];
        } elseif ($number < 20) {
            $chineseStr = '十' . $chineseArr [$number - 11];
        } elseif ($number < 30) {
            $chineseStr = '二十' . $chineseArr [$number - 21];
        } else {
            $chineseStr = '三十' . $chineseArr [$number - 31];
        }
        return $chineseStr;
    }