PHP Class TextAnalysis\Collocations\CollocationFinder

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

Protected Properties

Property Type Description
$nGramSize
$tokens

Public Methods

Method Description
__construct ( array $tokens, $nGramSize = 2 )
getCollocations ( ) : array Returns a naive implementation of collocations
getCollocationsByPmi ( ) : array Compute the Pointwise Mutual Information on the collocations

Method Details

__construct() public method

public __construct ( array $tokens, $nGramSize = 2 )
$tokens array

getCollocations() public method

Returns a naive implementation of collocations
public getCollocations ( ) : array
return array

getCollocationsByPmi() public method

Compute the Pointwise Mutual Information on the collocations
public getCollocationsByPmi ( ) : array
return array

Property Details

$nGramSize protected property

protected $nGramSize

$tokens protected property

protected $tokens