You are here

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

Replaces suffix y or Y with i if after non-vowel not @ word begin.

Parameters

string $word: The word to stem.

Return value

string The modified word.

1 call to Porter2::step1c()
Porter2::stem in src/Porter2.php
Computes the stem of the word.

File

src/Porter2.php, line 211

Class

Porter2
PHP Implementation of the Porter2 Stemming Algorithm.

Namespace

Drupal\porterstemmer

Code

protected static function step1c($word) {
  if ((self::hasEnding($word, 'y') || self::hasEnding($word, 'Y')) && strlen($word) > 2 && !self::isVowel(strlen($word) - 2, $word)) {
    $word = self::removeEnding($word, 'y');
    $word .= 'i';
  }
  return $word;
}