You are here

public function Stemmer::hasOverride in Snowball Stemmer 2.x

Same name and namespace in other branches
  1. 8 src/Stemmer.php \Drupal\snowball_stemmer\Stemmer::hasOverride()

Check for an overridden string.

Parameters

string $word: Word to be checked.

Return value

bool|string The value to use if overridden. FALSE if not an exception.

1 call to Stemmer::hasOverride()
Stemmer::stem in src/Stemmer.php
Stem a word.

File

src/Stemmer.php, line 84

Class

Stemmer
Service wrapper class for stemmer.

Namespace

Drupal\snowball_stemmer

Code

public function hasOverride($word) {
  if (isset($this->overrides[$this->language][$word])) {
    return $this->overrides[$this->language][$word];
  }
  if (isset($this->overrides[LanguageInterface::LANGCODE_NOT_SPECIFIED][$word])) {
    return $this->overrides[LanguageInterface::LANGCODE_NOT_SPECIFIED][$word];
  }
  return FALSE;
}