You are here

function doubleConsonant in Porter-Stemmer 5

Same name and namespace in other branches
  1. 6 porterstemmer.module \doubleConsonant()

Returns true/false as to whether the given string contains two of the same consonant next to each other at the end of the string.

Parameters

string $str String to check:

Return value

bool Result

2 calls to doubleConsonant()
step1ab in ./porterstemmer.module
Step 1
step5 in ./porterstemmer.module
Step 5

File

./porterstemmer.module, line 399

Code

function doubleConsonant($str) {
  $c = regex_consonant;
  return preg_match("#{$c}{2}\$#", $str, $matches) and $matches[0][0] == $matches[0][1];
}