You are here

function porterstemmer_step1c in Porter-Stemmer 6.2

Same name and namespace in other branches
  1. 7 includes/standard-stemmer.inc \porterstemmer_step1c()

Step 1c of algorithm: y suffixes

Parameters

$word: Word to stem, modified in place if successful.

Return value

TRUE if it is time to stop stemming, FALSE to continue.

2 calls to porterstemmer_step1c()
PorterStemmerInternalsUnitTest::testGeology in ./porterstemmer.test
Test internal steps on the word "geology".
porterstemmer_stem in ./porterstemmer.module
Stems a word, using the Porter Stemmer 2 algorithm.

File

./porterstemmer.module, line 527
This is an implementation of the Porter 2 Stemming algorithm from http://snowball.tartarus.org/algorithms/english/stemmer.html by Jennifer Hodgdon of Poplar ProductivityWare, www.poplarware.com

Code

function porterstemmer_step1c(&$word) {
  $tmp = $word;
  $didit = FALSE;

  // Replace y or Y by i if the letter before is not a vowel,
  // and that non-vowel is not the beginning of the word.
  $ytest = '/.' . PORTERSTEMMER_NOT_VOWEL . '[Yy]$/';
  porterstemmer_suffix($tmp, 'Y', 'i', $didit, $ytest) or porterstemmer_suffix($tmp, 'y', 'i', $didit, $ytest);
  return porterstemmer_step_ending($word, $tmp);
}