NlpTools API
Class

NlpTools\Analysis\FreqDist

class FreqDist

Extract the Frequency distribution of keywords

Methods

__construct(array $tokens)

This sorts the token meta data collection right away so use frequency distribution data can be extracted.

int getTotalTokens()

Get the total number of tokens in this tokensDocument

float getWeightPerToken()

Return the weight of a single token

int getTotalUniqueTokens()

Return get the total number of unique tokens

array getKeys()

Return the sorted keys by frequency desc

array getValues()

Return the sorted values by frequency desc

array getKeyValues()

Return the full key value store

array getHapaxes()

Returns an array of tokens that occurred once

Details

at line 30
public __construct(array $tokens)

This sorts the token meta data collection right away so use frequency distribution data can be extracted.

Parameters

array $tokens

at line 40
public int getTotalTokens()

Get the total number of tokens in this tokensDocument

Return Value

int

at line 60
public float getWeightPerToken()

Return the weight of a single token

Return Value

float

at line 69
public int getTotalUniqueTokens()

Return get the total number of unique tokens

Return Value

int

at line 78
public array getKeys()

Return the sorted keys by frequency desc

Return Value

array

at line 87
public array getValues()

Return the sorted values by frequency desc

Return Value

array

at line 96
public array getKeyValues()

Return the full key value store

Return Value

array

at line 107
public array getHapaxes()

Returns an array of tokens that occurred once

Return Value

array