Check if the preceding words increase, decrease, or negate/nullify the valence
@param string $word
@param float $valence
@param bool $isCapDiff
@return float
336395
public function scalarIncDec(string $word, float $valence, bool $isCapDiff)
    {
        $scalar = 0.0;
        $wordLower = strtolower($word);
        if(isset($this->boosterDict[$wordLower]))
        {
            $scalar = $this->boosterDict[$wordLower];
            if($valence < 0) {
                $scalar *= -1;
            }
            //check if booster/dampener word is in ALLCAPS (while others aren't)
            if(strtoupper($word) && $isCapDiff) {
                if ($valence > 0) {
                    $scalar += Vader::C_INCR;
                } else { 
                    $scalar -= Vader::C_INCR;
                }
            }
        }
        return $scalar;
    }
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;
	}
1035538
final protected function checkPrefix(string $res):int
    {
        if (!preg_match('/[\/\'^£$%&*()}{@#~?><>,|=+¬-]/', $res)  &&
            strpos($res, "\\") == false) {
            return (1);
        }
        return (-1);
    }
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;
    }
309882
function currentWord(x) {
    if ((x.b.data.wordWindow["0"] === token) &&
        (x.a === tag)) {
        return 1;
    }
    return 0;
  }
580262
public boolean isStopWord(String word,int minLen, int maxLen) {
		if (word.length() < minLen || word.length()>maxLen)
			return true;

		if (noise.matcher(word).matches())
			return true;

		if (sWord.contains(word))
			return true;

		return false;
	}
679995
private function hasValidSEnding($word)
    {
        $lastLetter = Utf8::substr($word, -1, 1);
        return !in_array($lastLetter, array_merge(self::$vowels, array('j')));
    }
1151656
public function isKeyword($word)
    {
        if ($this->keywords === null) {
            $this->initializeKeywords();
        }

        return isset($this->keywords[strtoupper($word)]);
    }
158454
protected function stemWord($word)
    {
        if ($this->isPlural($word)) {
            return $this->stemPluralWord($word);
        } else {
            return $this->stemSingularWord($word);
        }
    }
944782
@Deprecated
	public static int countOccurances(byte[] buff, int len, String word) {
		return countOccurrences(buff, len, word);
	}
270532
public function isVowel($word, $index)
    {
        if(strpbrk($word[$index], 'aeiou') !== false) {
            return true;
        } elseif($word[$index] === 'y' && strpbrk($word[--$index], 'aeiou') === false) {
            return true;
        } 
        return false;
    }
664836
public static function oneByWord($word)
	{
		$word = trim($word);
		$word = strtolower($word);

		return self::blank()
			->whereEquals('word', $word)
			->row();
	}
1015405
public static function stem($word)
    {
        $nounStem = self::roughStem(
            $word, self::$_nounMay, self::$_nounPre, self::$_nounPost, 
            self::$_nounMaxPre, self::$_nounMaxPost, self::$_nounMinStem
        );
        $verbStem = self::roughStem(
            $word, self::$_verbMay, self::$_verbPre, self::$_verbPost, 
            self::$_verbMaxPre, self::$_verbMaxPost, self::$_verbMinStem
        );
        
        if (mb_strlen($nounStem, 'UTF-8') < mb_strlen($verbStem, 'UTF-8')) {
            $stem = $nounStem;
        } else {
            $stem = $verbStem;
        }
        
        return $stem;
    }
1191508
protected function checkCondition($word, $condition)
    {
        return $condition == 'tag' ? $this->isTag($word) : !$this->isTag($word);
    }
307107
private static function step5($word)
	{
		// Part a
		if (substr($word, -1) == 'e')
		{
			if (self::m(substr($word, 0, -1)) > 1)
			{
				self::replace($word, 'e', '');
			}
			elseif (self::m(substr($word, 0, -1)) == 1)
			{
				if (!self::cvc(substr($word, 0, -1)))
				{
					self::replace($word, 'e', '');
				}
			}
		}

		// Part b
		if (self::m($word) > 1 && self::doubleConsonant($word) && substr($word, -1) == 'l')
		{
			$word = substr($word, 0, -1);
		}

		return $word;
	}
1250646
public boolean endsWith(String word)
    {
        word = reverse(word);
        return trie.commonPrefixSearchWithValue(word).size() > 0;
    }
466140
public function increase($fields, $where, float $diff = 1): int
    {
        return intval(self::crease('+', $fields, $where, $diff));
    }