nltk/nltk — pull request #256 by larsmans (2012-05-07 16:25:33+00:00)
Title: Rewrote BFS for correctness and speed

Please don't merge this in just yet, I have a few more tests to do. This PR is already here to let you know I'm working on it.

Solves issue #255. In addition:

* renamed the `depth` argument `maxdepth`; it wasn't used as a keyword argument, so this is harmless
* removed the `queue` argument, which wasn't being used
* replaced the `list`-based queue (O(*n*) pop) with a `deque`-based one (O(1) pop).