You are here

protected function Porter2::containsVowel in Search API 8

Checks whether the given string contains a vowel.

Parameters

string $string: The string to check.

Return value

bool TRUE if the string contains a vowel, FALSE otherwise.

2 calls to Porter2::containsVowel()
Porter2::step1a in src/Plugin/search_api/processor/Resources/Porter2.php
Handles various suffixes, of which the longest is replaced.
Porter2::step1b in src/Plugin/search_api/processor/Resources/Porter2.php
Handles various suffixes, of which the longest is replaced.

File

src/Plugin/search_api/processor/Resources/Porter2.php, line 611

Class

Porter2
Implements the Porter2 stemming algorithm.

Namespace

Drupal\search_api\Plugin\search_api\processor\Resources

Code

protected function containsVowel($string) {
  $inc = 0;
  $return = FALSE;
  while ($inc < strlen($string)) {
    if ($this
      ->isVowel($inc, $string)) {
      $return = TRUE;
      break;
    }
    $inc++;
  }
  return $return;
}