You are here

protected function SearchApiPorter2::isVowel in Search API 7

Checks whether a character is a vowel.

Parameters

int $position: The character's position.

string|null $word: (optional) The word in which to check. Defaults to $this->word.

string[] $additional: (optional) Additional characters that should count as vowels.

Return value

bool TRUE if the character is a vowel, FALSE otherwise.

5 calls to SearchApiPorter2::isVowel()
SearchApiPorter2::containsVowel in includes/processor_stemmer.inc
Checks whether the given string contains a vowel.
SearchApiPorter2::isShortSyllable in includes/processor_stemmer.inc
Determines whether the word ends in a "vowel-consonant" suffix.
SearchApiPorter2::R in includes/processor_stemmer.inc
Determines the start of a certain "R" region.
SearchApiPorter2::step1c in includes/processor_stemmer.inc
Replaces suffix y or Y with i if after non-vowel not @ word begin.
SearchApiPorter2::__construct in includes/processor_stemmer.inc
Constructs a SearchApiPorter2 object.

File

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

Class

SearchApiPorter2
Implements the Porter2 stemming algorithm.

Code

protected function isVowel($position, $word = NULL, $additional = array()) {
  if ($word === NULL) {
    $word = $this->word;
  }
  $vowels = array_merge(array(
    'a',
    'e',
    'i',
    'o',
    'u',
    'y',
  ), $additional);
  return in_array($this
    ->charAt($position, $word), $vowels);
}