public function getSynsetByOffsetAndPos($synsetOffset, $pos)
    {
        // check if the synset has already been cached
        if(isset($this->synsets[$pos.$synsetOffset])) {
            return $this->synsets[$pos.$synsetOffset];
        }
        
        $fileName = "data.{$this->posFileMaps[$pos]}";
        if(!in_array($fileName, $this->getDataFileNames())) {
            throw new RuntimeException("That is not a correct wordnet file {$fileName}");            
        } elseif(!file_exists($this->getDir().$fileName)) {
            throw new RuntimeException("Wordnet file missing {$fileName}");                        
        }
        
        
        $fh = fopen($this->getDir().$fileName,'r');        
        if(!$fh) {
            throw new RuntimeException("Could not open wordnet file for reading {$fileName}");                                    
        }        
        if(fseek($fh, $synsetOffset) === -1) {
            throw new RuntimeException("Could not seek to {$synsetOffset} in {$fileName}");
        }
        
        $line = trim(fgets($fh));
        fclose($fh);
        return $this->getSynsetFromString($line);
        
    }