public function getLexicon() : array
    {
        if(!file_exists($this->getTxtFilePath())) {
            throw new \RuntimeException('Package vader_lexicon must be installed, php textconsole pta:install:package vader_lexicon');
        }
        
        if(empty($this->lexicon)) {
            $fh = fopen($this->getTxtFilePath(), "r");
            while (($rows[] = fgetcsv($fh, 4096, "\t")) !== FALSE);
            
            fclose($fh);
            
            foreach($rows as $row)
            {
                $this->lexicon[$row[0]] = $row[1];
            }            
        }
        return $this->lexicon;
    }
public function getLexicon() : array
    {
        if(!file_exists($this->getTxtFilePath())) {
            throw new \RuntimeException('Package vader_lexicon must be installed, php textconsole pta:install:package vader_lexicon');
        }
        
        if(empty($this->lexicon)) {
            $fh = fopen($this->getTxtFilePath(), "r");
            while (($rows[] = fgetcsv($fh, 4096, "\t")) !== FALSE);
            
            fclose($fh);
            
            foreach($rows as $row)
            {
                $this->lexicon[$row[0]] = $row[1];
            }            
        }
        return $this->lexicon;
    }
public function getLexicon ( ) : array { if ( ! file_exists ( $ this -> getTxtFilePath ( ) ) ) { throw new \ RuntimeException ( 'Package vader_lexicon must be installed, php textconsole pta:install:package vader_lexicon' ) ; } if ( empty ( $ this -> lexicon ) ) { $ fh = fopen ( $ this -> getTxtFilePath ( ) , "r" ) ; while ( ( $ rows [ ] = fgetcsv ( $ fh , 4096 , "\t" ) ) !== FALSE ) ; fclose ( $ fh ) ; foreach ( $ rows as $ row ) { $ this -> lexicon [ $ row [ 0 ] ] = $ row [ 1 ] ; } } return $ this -> lexicon ; }
Loads the flat file data set
@return array
Loads the flat file data set