public function SearchApiPorter2::stem in Search API 7
Computes the stem of the word.
Return value
string The word's stem.
File
- includes/
processor_stemmer.inc, line 178  - Contains SearchApiPorterStemmer and SearchApiPorter2.
 
Class
- SearchApiPorter2
 - Implements the Porter2 stemming algorithm.
 
Code
public function stem() {
  // Ignore exceptions & words that are two letters or less.
  if ($this
    ->exceptions() || $this
    ->length() <= 2) {
    return strtolower($this->word);
  }
  else {
    $this
      ->step0();
    $this
      ->step1a();
    $this
      ->step1b();
    $this
      ->step1c();
    $this
      ->step2();
    $this
      ->step3();
    $this
      ->step4();
    $this
      ->step5();
  }
  return strtolower($this->word);
}