protected function getReplacement($word)
	{
		if ($this->isAllowed($word))
		{
			return $word;
		}

		foreach ($this->replacements as list($regexp, $replacement))
		{
			if (preg_match($regexp, $word))
			{
				return $replacement;
			}
		}

		return $this->defaultReplacement;
	}
protected function getReplacement($word)
	{
		if ($this->isAllowed($word))
		{
			return $word;
		}

		foreach ($this->replacements as list($regexp, $replacement))
		{
			if (preg_match($regexp, $word))
			{
				return $replacement;
			}
		}

		return $this->defaultReplacement;
	}
protected function getReplacement ( $ word ) { if ( $ this -> isAllowed ( $ word ) ) { return $ word ; } foreach ( $ this -> replacements as list ( $ regexp , $ replacement ) ) { if ( preg_match ( $ regexp , $ word ) ) { return $ replacement ; } } return $ this -> defaultReplacement ; }
Get the replacement for given word

@param  string $word Original word
@return string       Replacement if the word is censored, or the original word otherwise
Get the replacement for given word