"le service#s", "direction" => "la direction#s", ]; protected function ADJECTIVES(): array { return static::ADJECTIVES; } const ADJECTIVES = [ "ne" => "né#e" ]; function __construct() { $words = []; $i = 0; foreach ($this->WORDS() as $key => $word) { $word = new Word($word); if ($key === $i) $words[] = $word; else $words[$key] = $word; $i++; } $i = 0; foreach ($this->ADJECTIVES() as $key => $adjective) { $word = new Word($adjective, true); if ($key === $i) $words[] = $word; else $words[$key] = $word; $i++; } parent::__construct($words); } # ArrayAccess function has(string $key): bool { return $this->_has($key); } function get(string $key): Word { return ValueException::check_nn($this->_get($key), "$key: unknown word"); } function set(string $key, Word $value): self { return $this->_set($key, $value); } function del(string $key): self { return $this->_del($key); } # Iterator function key(): string { return $this->_key(); } function current(): Word { return $this->_current(); } }