public function getWords($fileId = null, $tokenizer = null)
    {
        if(!$tokenizer) { 
            $tokenizer = new GeneralTokenizer();
        }
        $fileIds = [];
        if(empty($fileId)) { 
            $fileIds = $this->getFileIds();
        } else {
            $fileIds = [$fileId];
        }
        
        $words = [];
        foreach($fileIds as $filename )
        {
            $content = file_get_contents($this->getPackage()->getInstallationPath().$filename);
            $words = array_merge($words, $tokenizer->tokenize($content));
            unset($content);
        }
        return $words;
    }
public function getWords($fileId = null, $tokenizer = null)
    {
        if(!$tokenizer) { 
            $tokenizer = new GeneralTokenizer();
        }
        $fileIds = [];
        if(empty($fileId)) { 
            $fileIds = $this->getFileIds();
        } else {
            $fileIds = [$fileId];
        }
        
        $words = [];
        foreach($fileIds as $filename )
        {
            $content = file_get_contents($this->getPackage()->getInstallationPath().$filename);
            $words = array_merge($words, $tokenizer->tokenize($content));
            unset($content);
        }
        return $words;
    }
public function getWords ( $ fileId = null , $ tokenizer = null ) { if ( ! $ tokenizer ) { $ tokenizer = new GeneralTokenizer ( ) ; } $ fileIds = [ ] ; if ( empty ( $ fileId ) ) { $ fileIds = $ this -> getFileIds ( ) ; } else { $ fileIds = [ $ fileId ] ; } $ words = [ ] ; foreach ( $ fileIds as $ filename ) { $ content = file_get_contents ( $ this -> getPackage ( ) -> getInstallationPath ( ) . $ filename ) ; $ words = array_merge ( $ words , $ tokenizer -> tokenize ( $ content ) ) ; unset ( $ content ) ; } return $ words ; }
Return an array of tokenized words
@param string|null $fileId
@param \TextAnalysis\Tokenizers\TokenizerAbstract
@return array
Return an array of tokenized words