public function getLemma($word, $pos = '')
    {
        if(empty($this->lemmasIdx)) {
            foreach($this->getWordnetCorpus()->getLemmas() as &$lemma) {
                $this->lemmasIdx["{$lemma->getWord()}.{$lemma->getPos()}"] = $lemma;
            }            
            // sort the keys for faster lookup
            ksort($this->lemmasIdx);
        }
        
        $found = [];
        
        // found 1
        if(isset($this->lemmasIdx["{$word}.{$pos}"])) {
            $found[] = $this->lemmasIdx["{$word}.{$pos}"];
        } else {
            foreach($this->getWordnetCorpus()->getPosFileMaps() as $key => $value)
            {
                if(isset($this->lemmasIdx["{$word}.{$key}"])) {
                    $found[] = $this->lemmasIdx["{$word}.{$key}"];
                }
            }
        }

        //attach the synsets for the lemmas
        foreach($found as $lemma)
        {
            if(empty($lemma->getSynsets())) {
                $synsets = [];
                foreach($lemma->getSynsetOffsets() as $fileOffset)
                {
                    $synsets[] = $this->getWordnetCorpus()->getSynsetByOffsetAndPos((int)$fileOffset, $lemma->getPos());
                }
                $lemma->setSynsets($synsets);
            }
        }       
        return $found;
    }