You are here

protected function SearchApiPorter2::hasEnding in Search API 7

Checks whether the word ends with the given string.

Parameters

string $string: The string.

Return value

bool TRUE if the word ends with the given string, FALSE otherwise.

8 calls to SearchApiPorter2::hasEnding()
SearchApiPorter2::step0 in includes/processor_stemmer.inc
Searches for the longest among the "s" suffixes and removes it.
SearchApiPorter2::step1a in includes/processor_stemmer.inc
Handles various suffixes, of which the longest is replaced.
SearchApiPorter2::step1b in includes/processor_stemmer.inc
Handles various suffixes, of which the longest is replaced.
SearchApiPorter2::step1c in includes/processor_stemmer.inc
Replaces suffix y or Y with i if after non-vowel not @ word begin.
SearchApiPorter2::step2 in includes/processor_stemmer.inc
Implements step 2 of the Porter2 algorithm.

... See full list

File

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

Class

SearchApiPorter2
Implements the Porter2 stemming algorithm.

Code

protected function hasEnding($string) {
  $length = strlen($string);
  if ($length > $this
    ->length()) {
    return FALSE;
  }
  return substr_compare($this->word, $string, -1 * $length, $length) === 0;
}