keywords === null) { $this->initializeKeywords(); } return isset($this->keywords[strtoupper($word)]); } /** * @return void */ protected function initializeKeywords() { $this->keywords = array_flip(array_map('strtoupper', $this->getKeywords())); } /** * Returns the list of keywords. * * @return string[] */ abstract protected function getKeywords(); /** * Returns the name of this keyword list. * * @return string */ abstract public function getName(); }