nltk/nltk — pull request #328 by heatherleaf (2012-12-21 11:00:08+00:00)
Title: Fixing `__cmp__` for 2and3

Here's a load of changes to the 2and3 branch.

I've changed all `__cmp__` to `__eq__` and `__lt__` together with a `@total_ordering`.

I have also made som changes to string handling, which might interfere with kmike's current work. Please look through them!

I've added a "text" format to `nltk.data.load` and added an optional `encoding` argument to several file reading and string parsing functions.

The following doctests now pass for py26, py27 and py32 (I don't have py33 so I can't test that):

- align ccg chat80 chunk collocations corpus data dependency drt featgram featstruct grammar grammartestsuites internals japanese logic metrics parse probability relextract resolution segmentation semantics simple stem tag tokenize tree treetransforms util wordnet

I can't test the following doctests, since I don't have the necessary dependencies:

- childes classify discourse gluesemantics inference nonmonotonic
- (but all gluesemantics tests pass until it tries to use the MaltParser)

The following four tests fail:

- misc portugese_en sourcedstring toolbox