Condition to see if the given word should be uppercase

@param $index
@param $word
@return bool
484976
protected function wordShouldBeUppercase($index, $word)
    {
        return
            (
                $this->isFirstWordOfSentence($index) ||
                $this->isLastWord($word) ||
                !$this->isIgnoredWord($word)
            ) &&
            (
                !$this->hasUppercaseLetter($word)
            );
    }
1080211
public static function titleize($word, $uppercase = '')
    {
        $uppercase = $uppercase == 'first' ? 'ucfirst' : 'ucwords';
        return $uppercase(self::humanize(self::underscore($word)));
    }
550361
protected function getPrefixAt($index)
    {
        $prefixes = $this->getPrefixes();
        return isset($prefixes[$index]) ? $prefixes[$index] : null;
    }
114665
public static function basedOnBlacklist($word)
	{
		$words[] = (string)$word;
		$words[] = strtolower($word);
		$words[] = strtolower(strrev($word));

		$len = strlen($word);
		$word2 = '';

		// @FIXME: badly inefficient
		for ($i = 0; $i < $len; $i++)
		{
			if (preg_match('/[a-zA-Z]/', $word[$i]))
			{
				$word2 .= $word[$i];
			}
		}

		$words[] = strtolower($word2);
		$words[] = strtolower(strrev($word2));
		$words[] = self::toL33t($word);
		$words[] = strrev(self::toL33t($word));
		$words[] = self::toSimpleL33t($word);
		$words[] = strrev(self::toSimpleL33t($word));

		$total = self::all()
			->whereIn('word', $words)
			->total();

		return ($total > 1); // returns true if char belongs to class
	}
1006742
public function has($index)
    {
        $index = (string) $index;

        return $this->get($index, null) !== null;
    }
1135577
public function isRoot($index)
	{
		if (isset($this->_list[$index])) {
			return ($this->_list[$index]->Type == self::OLE_PPS_TYPE_ROOT);
		}
		return false;
	}
766982
private function hasValidSEnding($word)
    {
        $lastLetter = Utf8::substr($word, -1, 1);
        if (in_array($lastLetter, array('b', 'c', 'd', 'f', 'g', 'h', 'j', 'l', 'm', 'n', 'o', 'p', 'r', 't', 'v', 'y', 'z'))) {
            return true;
        }
        if ($lastLetter == 'k') {
            $beforeLetter = Utf8::substr($word, -2, 1);
            if (!in_array($beforeLetter, self::$vowels)) {
                return true;
            }
        }
        return false;
    }
742212
public static function isset(string $index):bool
    {
        return (isset(self::$framework_paths[$index])? true : false);
    }
968970
public static function uppercase(string $str, string $encoding = null) : bool
    {
        return static::matchesPattern($str, '^[[:upper:]]*$', $encoding);
    }
461265
public static function camelCase($word)
    {
        if (isset(static::$camelCache[$word])) {

            return static::$camelCache[$word];

        }

        return static::$camelCache[$word] = lcfirst(static::studlyCase($word));
    }
308760
public function isBetterThan(Index $index)
    {
        if ($this->hasSameColumnNames($index->getColumnNames()) && $this->isUnique() && !$index->isUnique()) {
            return true;
        }

        return false;
    }
409953
public function match(string $word)
    {
        $this->processAbbreviations();
        $word = strtolower($word);

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

        return false;
    }
527248
public function hasIndex($index)
    {
        if ($index instanceof Index) {
            $index = $index->getName();
        }

        return \in_array($index, $this->_indices);
    }
1330325
def uppercase_word(event):
    
    buff = event.current_buffer

    for i in range(event.arg):
        pos = buff.document.find_next_word_ending()
        words = buff.document.text_after_cursor[:pos]
        buff.insert_text(words.upper(), overwrite=True)
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;
	}
375647
public static boolean is(String word){      
        if(word == null){
            return false;
        }
        word = word.trim();
        return isStopChar(word) || stopwords.contains(word);
    }
511743
public function upperCaseWords()
    {
        return $this->cloneInstance(
            function (StringObject $new) {
                $new->string = Mbstring::ucwords($new->string, $this->encoding);
            }
        );
    }