Check if a word is based on a name

@param   string  $word
@param   string  $name
@return  bool
511433
public static function isBasedOnName($word, $name)
	{
		$word = self::normalize($word);

		if (empty($word))
		{
			return false;
		}

		$names = explode(" ", $name);

		$count = count($names);
		$words = array();

		$fullname = self::normalize($name);

		$words[] = $fullname;
		$words[] = strrev($fullname);

		foreach ($names as $e)
		{
			$e = self::normalize($e);

			if (strlen($e) > 3)
			{
				$words[] = $e;
				$words[] = strrev($e);
			}
		}

		if ($count > 1)
		{
			$e = self::normalize($names[0] . $names[$count-1]);

			$words[] = $e;
			$words[] = strrev($e);
		}

		foreach ($words as $w)
		{
			if (empty($w))
			{
				continue;
			}

			if (strpos($w, $word) !== false)
			{
				return true;
			}
		}

		return false;
	}
465662
public function isCommand($name) {
        if (!$this->docoptResult)
            return false;

        if (!($len=strlen($name)) || !isset($this->docoptResult[$name]))
            return false;
        return (bool) preg_match('/^[a-z]+$/', $name);
    }
540077
private function hasValidEnEnding($word)
    {
        $lastLetter = Utf8::substr($word, -1, 1);
        if (in_array($lastLetter, self::$vowels)) {
            return false;
        }

        $threeLastLetters = Utf8::substr($word, -3, 3);
        if ($threeLastLetters == 'gem') {
            return false;
        }
        return true;
    }
54163
public function hasTag($name)
    {
        foreach ($this->tags as $tag) {
            if (strtolower($tag->getName()) == $name) {
                return true;
            }
        }
        return false;
    }
1226280
private static function extractWords($name) {
        /** @noinspection ReturnFalseInspection */
        if (false === strpos($name, '_')) {
            $r = preg_replace('#[A-Z]#', ' $0', $name);
        } else {
            $r = strtr($name, array('_' => ' '));
        }
        $r = strtolower(ltrim($r));
        return $r;
    }
612890
public function isCountable($word)
	{
		return ! (\in_array($this->str->lower(\strval($word)), $this->uncountableWords));
	}
1108969
private function isSearchedTrait($name)
    {
        if ($this->name === $name) {
            return true;
        }

        if (strpos($name, '\\') === 0) {
            return $this->name === $name || '\\' . $this->name === $name;
        }

        $name = $this->declaringClass->getNamespaceName() . '\\' . $name;

        return $this->name === $name || $this->name === '\\' . $name;
    }
512819
public function has($name)
    {
        $name = self::normalizeName($name);

        if (strpos($name, '[') !== false) {
            $names = explode('[', str_replace(']', '', $name));
            $key = array_shift($names);
            $item = isset($this->parameters[$key]) ? $this->parameters[$key] : [];

            foreach ($names as $key) {
                if (!isset($item[$key])) {
                    return false;
                }

                $item = $item[$key];
            }

            return !empty($item);
        }

        return !empty($this->parameters[$name]);
    }
238066
private function checkName(&$name)
    {
        if (! is_string($name)) {
            throw new InvalidTypeException(
                'The tag type must be a string, ' . gettype($name) . ' is given.'
            );
        }

        $name = strtolower(trim($name));
    }
585785
public function __isset($name) : bool
    {
        return in_array($name, $this->explorableIndex, true) && isset($this->{$name});
    }
571342
public function isUsing($name)
    {
        if (isset($this->using)) {
            if ($this->using->getName() == $name) {
                return true;
            }
        }

        return false;
    }
827014
public function has($name) {
        $field = Condition::safeField($name);

        return isset ($this->names [ $field ]);
    }
409953
public function match(string $word)
    {
        $this->processAbbreviations();
        $word = strtolower($word);

        if ($this->abbreviations && isset($this->abbreviations[$word])) {
            return $this->abbreviations[$word];
        }

        return false;
    }
642242
public function hasHeader(string $name) : bool
    {
        $name = strtolower($name);

        return isset($this->headers[$name]);
    }
244291
public function has(string $name): bool
    {
        return isset($this->stack[$this->normalizeName($name)]);
    }
496605
public static function isValidName( $name ): bool
	{
		$len = strlen($name);
		if( $len < 5 || ! preg_match('/^on[A-Z][a-zA-Z]*$/', $name) )
		{
			return false;
		}

		return $len < 256;
	}
375647
public static boolean is(String word){      
        if(word == null){
            return false;
        }
        word = word.trim();
        return isStopChar(word) || stopwords.contains(word);
    }