public function getWord(string $word)
    {
        if (isset($this->words[strtolower($word)])) {
            return new SpecialWord($word, $this->words[strtolower($word)][0], $this->words[strtolower($word)][1]);
        }

        return new Word($word);
    }
public function getWord(string $word)
    {
        if (isset($this->words[strtolower($word)])) {
            return new SpecialWord($word, $this->words[strtolower($word)][0], $this->words[strtolower($word)][1]);
        }

        return new Word($word);
    }
public function getWord ( string $ word ) { if ( isset ( $ this -> words [ strtolower ( $ word ) ] ) ) { return new SpecialWord ( $ word , $ this -> words [ strtolower ( $ word ) ] [ 0 ] , $ this -> words [ strtolower ( $ word ) ] [ 1 ] ) ; } return new Word ( $ word ) ; }
Returns an instance of Word or SpecialWord for the word provided.

@param string $word The word we are looking to get.
@return SpecialWord|Word The Word instance if it is normal, and SpecialWord if it exists in our store.
Returns an instance of Word or SpecialWord for the word provided .