@param string $word Word

@return array
12398
private function getCases($word)
    {
        $cases = array_fill_keys([
            'accusative',
            'genitive',
            'multiple',
        ], $word);

        if (!preg_match('/[а-яА-Я]+/', $word) || StringsUtil::isUppercase($word)) {
            return $cases;
        }

        $xml = @file_get_contents(self::CASE_API_URL.urlencode($word), null, stream_context_create([
            'http' => [
                'timeout' => self::CASE_API_TIMEOUT,
            ],
        ]));

        if (false === $xml) {
            return $cases;
        }

        $doc = simplexml_load_string($xml);

        if (false === $doc) {
            return $cases;
        }

        $doc = (array) $doc;

        if (isset($doc['code'])) {
            return $cases;
        }
        if (isset($doc['множественное'])) {
            $doc['множественное'] = (array) $doc['множественное'];
            $cases['multiple'] = $doc['множественное']['И'];
        }

        $cases['accusative'] = $doc['В'];
        $cases['genitive'] = $doc['Р'];

        return $cases;
    }
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);
	}
17610
protected function mapCode($word)
    {
        $encodedWord = '';
        
        $max   = mb_strlen($word, 'UTF-8');
        
        for ($i=0; $i < $max; $i++) {
            $char = mb_substr($word, $i, 1, 'UTF-8');
            if (isset($this->_map["$char"])) {
                $encodedWord .= $this->_map["$char"];
            } else {
                $encodedWord .= '0';
            }
        }
        
        return $encodedWord;
    }
935364
public static function pluralize($word)
    {
        //Get the cached noun of it exists
        if(isset(self::$_cache['pluralized'][$word])) {
            return self::$_cache['pluralized'][$word];
        }

        //Create the plural noun
        if (in_array($word, self::$_rules['countable'])) {
            self::$_cache['pluralized'][$word] = $word;
            return $word;
        }

        foreach (self::$_rules['pluralization'] as $regexp => $replacement)
        {
            $matches = null;
            $plural = preg_replace($regexp, $replacement, $word, -1, $matches);
            if ($matches > 0) {
                self::$_cache['pluralized'][$word] = $plural;
                return $plural;
            }
        }

        return $word;
    }
1104998
public static function underscore($word)
        {
            if (isset(static::$_underscored[$word])) {
                return static::$_underscored[$word];
            }

            return static::$_underscored[$word] = static::lower(static::slug($word, '_'));
        }
461265
public static function camelCase($word)
    {
        if (isset(static::$camelCache[$word])) {

            return static::$camelCache[$word];

        }

        return static::$camelCache[$word] = lcfirst(static::studlyCase($word));
    }
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);
    }
854584
public function getWordCount($word)
    {
        if (is_null($this->_localWords)) {
            $this->_localWords = $this->getRawWordCounts();
        }
        return isset($this->_localWords[$word]) ? $this->_localWords[$word] : 0;
    }
1248722
protected function trimRep($word)
    {
        $lastChar  = null;
        $cleanWord = null;
        $max       = mb_strlen($word, 'UTF-8');
        
        for ($i = 0; $i < $max; $i++) {
            $char = mb_substr($word, $i, 1, 'UTF-8');
            if ($char != $lastChar) {
                $cleanWord .= $char;
            }
            $lastChar = $char;
        }
        
        return $cleanWord;
    }
312841
protected function singularize($word)
    {
        $result = strval($word);

        if (in_array(strtolower($result), $this->uncountableWords())) {
            return $result;
        } else {
            foreach ($this->singularRules() as $rule => $replacement) {
                if (preg_match($rule, $result)) {
                    $result = preg_replace($rule, $replacement, $result);
                    break;
                }
            }

            return $result;
        }
    }
489772
private function isReservedWord($word)
    {
        if ($word[0] === '`') {
            $word = str_replace('`', '', $word);
        }

        $keywordLists = [];
        foreach ($this->keywordLists as $keywordList) {
            if (! $keywordList->isKeyword($word)) {
                continue;
            }

            $keywordLists[] = $keywordList->getName();
        }

        return $keywordLists;
    }
827281
public static function pluralize(string $word): string
	{
		if (isset(static::$_cache['pluralize'][$word])) {
			return static::$_cache['pluralize'][$word];
		}

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

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

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

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

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

			return $word;
		}

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

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

		return $word;
	}
1281338
public function searchContent($word) {
		$index   = $this->addFilter(new SearchContent($word));
		$content = $this->listFiles(true);
		$this->removeFilter($index);

		return $content;
	}
714815
protected function stripTagAttributes($word)
    {
        $space = $this->stringUtil->strpos($word, ' ', 1);

        if ($space) {
            return '<' . $this->stringUtil->substr($word, 1, $space) . '>';
        }

        return trim($word, '<>');
    }
748681
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;
	}
1283981
public function suggest($word) 
    {
        if (!pspell_check($this->pSpell, $word)) {
            return pspell_suggest($this->pSpell, $word);
        }
        else {
            return [$word];
        }
    }
75932
public static function rtrimWord($string, $word)
    {
        $end = mb_substr($string, 0-mb_strlen($word));
        if ($end != $word) {
            return $string;
        }
        return mb_substr($string, 0, mb_strlen($string)-mb_strlen($word));
    }