nltk/nltk — pull request #421 by michelleful (2013-06-22 20:32:15+00:00)
Title: Added checking for zero depth in lch_similarity

lch_similarity method raises a ZeroDivisionError when a synset has no hypernyms, since LCH distance is -log(p/2d), so when d == 0, it throws a ZeroDivisionError.

I added checking for when depth == 0 and had the function return None in this case, as LCH similarity is undefined in this instance.