PHP Class TextAnalysis\Generators\StopwordGenerator

Author: dcardin
Mostra file Open project: yooper/php-text-analysis Class Usage Examples

Protected Properties

Property Type Description
$filePaths Array of file paths of documents to be scanned
$mode
$stopWords array

Public Methods

Method 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

Protected Methods

Method 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 method

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

__destruct() public method

public __destruct ( )

computeUsingFreqDist() protected method

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

getFileContent() protected method

Returns the text content from the file
protected getFileContent ( string $filePath ) : string
$filePath string
return string

getFilePaths() public method

Returns the array of file paths
public getFilePaths ( ) : string[]
return string[]

getStopwords() public method

Returns an array of stop words and their frequencies
public getStopwords ( ) : string[]
return 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
return array