incorporated David Doukhan's pull request https://github.com/nltk/nltk/pull/345 , specified float return type, added doctests, misc formatting fixes
incorporated David Doukhan's pull request https://github.com/nltk/nltk/pull/345 , specified float return type, added doctests, misc formatting fixes

nltk/nltk,nltk/nltk,nltk/nltk