Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 750 by
Twinc...@gmail.com: Deletion of FreqDist element does not
reset cache
http://code.google.com/p/nltk/issues/detail?id=750
What version of NLTK are you using? 2.0.4
What steps will reproduce the problem? included
What is the expected output?
len 2
valid-gram1
valid-gram2
What do you see instead?
len 2
some-gram1
some-gram2
...
valid-gram1
...
valid-gram2
...
some-gramN
Analisys:
AbstractCollocationFinder.apply_freq_filter() use del operator to delete
filtered ngrams from FreqDist, but FreqDist does not update cache after
this deletion.
My advice:
FreqDist class should contain __delitem__ method with next code:
def __delitem__(self, sample):
dict.__delitem__(self, sample)
self._reset_caches()
Attachments:
freqdist_delitem.py 381 bytes
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings