PHP Class TextAnalysis\Generators\StopwordGenerator

Author: dcardin
Afficher le fichier Open project: yooper/php-text-analysis Class Usage Examples

Protected Properties

Свойство Type Description
$filePaths Array of file paths of documents to be scanned
$mode
$stopWords array

Méthodes publiques

Méthode Description
__construct ( array $filePaths, integer $mode = self::MODE_FREQ )
__destruct ( )
getFilePaths ( ) : string[] Returns the array of file paths
getStopwords ( ) : string[] Returns an array of stop words and their frequencies

Méthodes protégées

Méthode Description
computeUsingFreqDist ( array $tokens ) Adds frequency counts to the stopWords property
getFileContent ( string $filePath ) : string Returns the text content from the file

Method Details

__construct() public méthode

public __construct ( array $filePaths, integer $mode = self::MODE_FREQ )
$filePaths array
$mode integer

__destruct() public méthode

public __destruct ( )

computeUsingFreqDist() protected méthode

Adds frequency counts to the stopWords property
protected computeUsingFreqDist ( array $tokens )
$tokens array

getFileContent() protected méthode

Returns the text content from the file
protected getFileContent ( string $filePath ) : string
$filePath string
Résultat string

getFilePaths() public méthode

Returns the array of file paths
public getFilePaths ( ) : string[]
Résultat string[]

getStopwords() public méthode

Returns an array of stop words and their frequencies
public getStopwords ( ) : string[]
Résultat string[]

Property Details

$filePaths protected_oe property

Array of file paths of documents to be scanned
protected $filePaths

$mode protected_oe property

protected $mode

$stopWords protected_oe property

protected array $stopWords
Résultat array