You are here

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

Checks whether the given string is contained in R1.

Parameters

string $word: The word to check.

string $string: The string.

Return value

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

3 calls to Porter2::inR1()
Porter2::step2 in src/Porter2.php
Implements step 2 of the Porter2 algorithm.
Porter2::step3 in src/Porter2.php
Implements step 3 of the Porter2 algorithm.
Porter2::step5 in src/Porter2.php
Implements step 5 of the Porter2 algorithm.

File

src/Porter2.php, line 538

Class

Porter2
PHP Implementation of the Porter2 Stemming Algorithm.

Namespace

Drupal\porterstemmer

Code

protected static function inR1($word, $string) {
  $r1 = substr($word, self::r($word, 1));
  return strpos($r1, $string) !== FALSE;
}