You are here

protected static function Porter2::inR2 in Porter-Stemmer 8

Checks whether the given string is contained in R2.

Parameters

string $word: The word to check.

string $string: The string.

Return value

bool TRUE if the string is in R2 in the word, FALSE otherwise.

3 calls to Porter2::inR2()
Porter2::step3 in src/Porter2.php
Implements step 3 of the Porter2 algorithm.
Porter2::step4 in src/Porter2.php
Implements step 4 of the Porter2 algorithm.
Porter2::step5 in src/Porter2.php
Implements step 5 of the Porter2 algorithm.

File

src/Porter2.php, line 554

Class

Porter2
PHP Implementation of the Porter2 Stemming Algorithm.

Namespace

Drupal\porterstemmer

Code

protected static function inR2($word, $string) {
  $r2 = substr($word, self::r($word, 2));
  return strpos($r2, $string) !== FALSE;
}