Made the Python parser work with both NLTK v2 and NLTK v3.