nltk/nltk — Issue #238: "from nltk import util" imports nltk.cluster.util instead of nltk.util
Author: dan-blanchard
Created: 2012-03-02 19:15:24+00:00
State: open

I have a lot of code that uses the `util.ngrams` iterator, and I noticed that after the latest release I kept getting `AttributeError: 'module' object has no attribute 'ngrams'` errors all over the place. It turns out that in the latest release when you try to import the `nltk.util` module, it actually imports the `nltk.cluster.util` now. You can actually get around this by directly importing the functions you want like `from nltk.util import ngrams`, but it'd be really nice if it went back to the way it was before.