| Trees | Indices | Help |
|
|---|
|
|
object --+
|
dict --+
|
nltk.probability.FreqDist --+
|
CutoffFreqDist
Like FreqDist, but returns zero counts for everything with a count less than a given cutoff. Also adjusts the total count to account for the lost counts.
|
|||
new empty dictionary |
|
||
|
|||
|
|||
|
|||
int
|
|
||
int
|
|
||
|
|||
| float |
|
||
FreqDist
|
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from Inherited from Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
|
cutoff Make cutoff a read-only attribute |
|||
|
Inherited from |
|||
|
|||
Construct a new frequency distribution. If In particular,
|
x[y]
|
Returns the raw counts (i.e. without the cutoff applied) as a dictionary. This could, for example, be used as init data to another FreqDist. |
|
This is slightly more complicated than the superclass, because we want to count only samples that have non-zero counts after the cutoff has been applied. |
len(x)
|
Have to override this because the superclass doesn't use N(), but the internal _N to calculate the frequency.
|
Create a copy of this frequency distribution.
|
Returns a CutoffFreqDist like this one, but with counts from the other added. The other may only be another CutoffFreqDist.
|
Add our own caches to the superclass'
|
Need to override this because dict.items(self) accesses the non-cutoff values.
|
|
|||
cutoffMake cutoff a read-only attribute
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Nov 26 16:04:58 2012 | http://epydoc.sourceforge.net |