fixed python compatibility bugs in nonprojectivedependencyparser

fixed python compatibility bugs in nonprojectivedependencyparser, c.f. https://github.com/nltk/nltk/issues/622