public function getStopwords()
    {
        if(!empty($this->stopWords)) {
            return $this->stopWords;
        }
                
        foreach($this->getFilePaths() as $filePath)
        {
            $content = $this->getFileContent($filePath);
            $doc = new TokensDocument((new GeneralTokenizer())
                    ->tokenize($content) );
            $doc->applyTransformation(new LowerCaseFilter())
                ->applyTransformation(new PossessiveNounFilter())
                ->applyTransformation(new PunctuationFilter())
                ->applyTransformation(new CharFilter());
            
            if($this->mode === self::MODE_FREQ) {
                $this->computeUsingFreqDist($doc->getDocumentData());
            }
            
        }
        arsort($this->stopWords);
        return $this->stopWords;                        
    }
public function getStopwords()
    {
        if(!empty($this->stopWords)) {
            return $this->stopWords;
        }
                
        foreach($this->getFilePaths() as $filePath)
        {
            $content = $this->getFileContent($filePath);
            $doc = new TokensDocument((new GeneralTokenizer())
                    ->tokenize($content) );
            $doc->applyTransformation(new LowerCaseFilter())
                ->applyTransformation(new PossessiveNounFilter())
                ->applyTransformation(new PunctuationFilter())
                ->applyTransformation(new CharFilter());
            
            if($this->mode === self::MODE_FREQ) {
                $this->computeUsingFreqDist($doc->getDocumentData());
            }
            
        }
        arsort($this->stopWords);
        return $this->stopWords;                        
    }
public function getStopwords ( ) { if ( ! empty ( $ this -> stopWords ) ) { return $ this -> stopWords ; } foreach ( $ this -> getFilePaths ( ) as $ filePath ) { $ content = $ this -> getFileContent ( $ filePath ) ; $ doc = new TokensDocument ( ( new GeneralTokenizer ( ) ) -> tokenize ( $ content ) ) ; $ doc -> applyTransformation ( new LowerCaseFilter ( ) ) -> applyTransformation ( new PossessiveNounFilter ( ) ) -> applyTransformation ( new PunctuationFilter ( ) ) -> applyTransformation ( new CharFilter ( ) ) ; if ( $ this -> mode === self :: MODE_FREQ ) { $ this -> computeUsingFreqDist ( $ doc -> getDocumentData ( ) ) ; } } arsort ( $ this -> stopWords ) ; return $ this -> stopWords ; }
Returns an array of stop words and their frequencies
@return string[]
Returns an array of stop words and their frequencies