You are here

protected function SearchApiPorter2::step0 in Search API 7

Searches for the longest among the "s" suffixes and removes it.

Implements step 0 of the Porter2 algorithm.

1 call to SearchApiPorter2::step0()
SearchApiPorter2::stem in includes/processor_stemmer.inc
Computes the stem of the word.

File

includes/processor_stemmer.inc, line 217
Contains SearchApiPorterStemmer and SearchApiPorter2.

Class

SearchApiPorter2
Implements the Porter2 stemming algorithm.

Code

protected function step0() {
  $found = FALSE;
  $checks = array(
    "'s'",
    "'s",
    "'",
  );
  foreach ($checks as $check) {
    if (!$found && $this
      ->hasEnding($check)) {
      $this
        ->removeEnding($check);
      $found = TRUE;
    }
  }
}